LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 07-30-2003, 12: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, 02:01 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,527

Rep: Reputation: 147Reputation: 147
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, 03: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, 05:49 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,527

Rep: Reputation: 147Reputation: 147
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


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

Main Menu
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