LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   how to acheive "wait for an event" mechanism in pthreads (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-acheive-wait-for-an-event-mechanism-in-pthreads-516542/)

jasdeep.js 01-05-2007 05:51 AM

how to acheive "wait for an event" mechanism in pthreads
 
Hi,
I am using RH9-2.4.21 and working with pthreads.
i want to implement the event mechanism-- like waiting for an event,signaling to the waiting task when the event has occured etc.

how to acheive the event mechanism in linux in general and pthreads in particular.

Thanks
jasdeep

wjevans_7d1@yahoo.co 01-05-2007 06:09 AM

pthreads programming
 
I've discovered a few things in my (rather extensive) experience with pthreads.

It isn't a good idea to find a recipe to do a particular thing in pthreads, and then go do it. It's much better in the long run to get a thorough understanding of how pthreads work. The reason for this is that debugging programs using pthreads can be frustrating and time-consuming, and it is easy (if you don't know thoroughly and anally what you're doing) to write a program that's impossible to debug well.

I'd recommend that you fork over a few bucks and get David R. Butenhof's book _Programming with POSIX Threads_, published by Addison Wesley. Do _not_ get _Pthreads Programming_ from O'Reilly. It doesn't convey the deeper understanding you really need to do pthreads programming correctly.

Hope this helps.


All times are GMT -5. The time now is 12:30 PM.