Try using the pthread_mutex calls, or the pth equivalent.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of Ricardo Nabinger Sanchez
Sent: Thursday, August 26, 2004 11:22 PM
To: [EMAIL PROTECTED]
Subject: semaphores
Hello,
I'm a new pth user (started today! :) ), and am looking for a nice way to
implement a semaphore under libpth. My application currently uses pthread's
sem_post/sem_wait functions, and I'm still wondering which of the pth's
functions is the proper one.
My app consists of a consumer/producer threads model, and they share a large
buffer. I need that the consumer locks when there's no data. The expected
production rate is very high (up to 150,000 items per second) and in form of
bursts.
Currently, I'm analysing:
* pth_suspend / pth_resume
* pth_cond_await / pth_cond_notify
For simplicity, as I'm not experienced pth user, I've chosen pth_suspend /
pth_resume functions. Any suggestions?
Thanks in advance.
Best regards.
--
Ricardo Nabinger Sanchez
GNU/Linux #140696 [http://counter.li.org]
Slackware Linux + FreeBSD
Warning:
Trespassers will be shot.
Survivors will be shot again.
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
Development Site http://www.ossp.org/pkg/lib/pth/
Distribution Files ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
Development Site http://www.ossp.org/pkg/lib/pth/
Distribution Files ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]