Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
how do you get pthread to wait for
Name: nace33 Date: September 29, 2004 at 11:29:08 Pacific OS: debian CPU/Ram: p4
Comment:
I am trying to figure out how to have two pthreads interact with one another...I am using mutex to lock the threads out but, the other threads don't stop where they are. How do you get the other threads to suspend or wait for the the thread thats in the critical section. My problem is that i am reading in data from files and i need them read in a certain order...here is my locking code.
//mutex lock pthread_mutex_lock(&mtx);
//messageWrite(temp2); message.append(temp2);
//mutex unlock pthread_mutex_unlock(&mtx);
i know it is locking out the other process but i need them to stop while the thread is in this area...any help pleeease, very frustrating.
Name: fpmurphy Date: September 29, 2004 at 17:49:32 Pacific
Reply:
Its simple - a POSIX thread calling pthread_mutex_lock() to lock the mutex either gets exclusive access to the code starting from the successful locking until its call to unlock the mutex, or it waits until the mutex is unlocked by the thread that locked it.
Summary: I also had the same problem, but windows98 actually ate my lilo when I reinstalled it. The version of win98 I had to use was "Windows for systems without windows" If you can boot into a dos prompt (...
Summary: Hi How do I get awk to print out the name of a file instead of the contents. I'm currently writing a csh script that looks like this. #!/bin/csh set previous = $6 if($6 == "")then ./anotherscri...
Summary: hOW DO YOU REMOTE MOUNT A CD ? I AM USING DIGITAL (COMPAQ TRUE 64) OR WHAT IS THE COMMAND USED TO REMOTE MOUNT A CD FROM THE COMMAND LINE? ...