[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming.threads

Re: pthread_cond_t vs pthread_mutex_t

gauravlnmiitjaipur

9/17/2015 11:45:00 AM

On Tuesday, July 14, 1998 at 12:30:00 PM UTC+5:30, Jason Mancini wrote:
> I wrote a small program that loops many times,
> locking and unlocking 3 mutexes. The results are
> 4.2 million mutex lock-unlocks per second. Doing the same
> for two threads that wait and signal each other results
> in 26,000 wait-signals per second using conditional
> variables.
>
> Any explanations as to why conds are so much slower
> than mutexes? There are no collisions in any of the
> mutex acquisitions. Also it seems like the mutex rate
> should be higher that it is.
>
> Is there anything faster available for putting many
> threads to sleep and waking them up many times a
> second?
>
> Thanks, Jason
yeah