10 More Discussions You Might Find Interesting
1. Programming
Hi,
I wrote the following program to understand mutexes. If I run the program , number of threads is shown as zero, even after creating one thread. When running with gdb, it works fine.
The function process is used to update global variable (used to keep track of threads). It looks like the... (2 Replies)
Discussion started by: sanjayc
2 Replies
2. Programming
Hello all,
Is there any way that I can signal (wake) all threads that I have created without using pthread_cond_broadcast?
Cheers!
Aaron (6 Replies)
Discussion started by: mobility
6 Replies
3. Programming
Using pthreads is there a way to determine how many threads are waiting on a locked resource? I mean, once a shared resource is protected using e.g. pthread_rwlock_t or pthread_mutex_t one thread grabs the lock and other threads will go to sleep waiting for the resource to be available again. Is... (0 Replies)
Discussion started by: muggu
0 Replies
4. Programming
Hi all,
I have a scenario where I need to use the mutex locks. The mutex locks are working fine, but sometimes I am getting into the dead lock situation.
Below is the summary of my code :
MUTEX LOCK
performTask();
MUTEX UNLOCK.
In some cases I get into the situation where... (2 Replies)
Discussion started by: cjjoy
2 Replies
5. Programming
I am trying to use mutex in my multi-tread project, but they don't seem to work.
I have created a simple demonstration of the problem. This is NOT how I would use a mutex, only a demonstration of the problem:
#include <stdio.h>
#include <pthread.h>
int main()
{
int val;
... (3 Replies)
Discussion started by: ChrisWilliams
3 Replies
6. Programming
Hello,
I run my pthread code on Linux with 4 processors. However, the speed up is only 2 times.
The code is about solving equation (G+s(i)C)z(i)=B*us(i), i=1,...,n. Here G,C are m*m matrix, B*us(i) is a m*1 vector and s(i) are n different numbers. I need to solve the equation n times to... (1 Reply)
Discussion started by: mgig
1 Replies
7. AIX
Running dedicated on AIX with 4 processors, creating 4 threads, each with equal work to do, only runs about 20% faster than 1 thread with all of the work. Test case has no blocking but does share memory for read access only.
Any ideas why I'm only seeing 20% gain? Is this typical on AIX? ... (1 Reply)
Discussion started by: ldarden
1 Replies
8. AIX
Is it possible that the function "pthread_cond_broadcast" block itself and the function "pthread_cond_wait" unblock in multi-threads programming ? The operating system is AIX 5.2, its maintenance level is : 5.2.0.4, VisualAge C++ 6.0.
Thanks (0 Replies)
Discussion started by: Frank2004
0 Replies
9. UNIX for Dummies Questions & Answers
Can anyone explain me what mutexes are in
multithreading environment? (2 Replies)
Discussion started by: sagar
2 Replies
10. Programming
Hi all,
I am working in a UNIX/C environment. I would like to understand more about MUTEX and Threads. Can someone explain me these
concepts and how they are related.
Vijay (2 Replies)
Discussion started by: vthasan
2 Replies