LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-30-2003, 01:03 PM   #1
ldamian
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Rep: Reputation: 0
pthread , signal/wait


Hi, I need to implement pthread wait and signal operations that will guarantee a FIFO instead of the random wakeup that pthread_cond_signal has.
I'm required to use conditional variables and mutexes.

Any ideas on where to start?
 
Old 07-30-2003, 03:01 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
You need a list (FIFO) of processes and a mutex to protect it. Idea is quite simple, but implementation's harder - if possible try to use as much of pthread as you can (especially data structures). You need to dig deep into pthread, I think.
 
Old 07-30-2003, 04:44 PM   #3
ldamian
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Yea I agree..Know where I can get the code for pthread_cond_signal and pthread_cond_wait functions?

I'm thinking I'll just use what they have and change it somewhat.
 
Old 07-31-2003, 06:49 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
For exampel here: ftp://ftp.gnu.org/gnu/glibc/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to wait for the "vsync" signal ? e-miel Programming 2 11-22-2005 12:47 PM
wait() and signal() applies on which process ...? indian Programming 5 12-01-2004 03:43 PM
pthread signal problem again xinwang00 Programming 4 11-18-2003 03:21 PM
pthread signal problem xinwang00 Programming 12 11-11-2003 03:30 PM
pthread signal problem xinwang00 Linux - Software 2 11-07-2003 01:05 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration