This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Encouraging the kernel(?) to more efficiently wake my threads


Hi,

Chris Stankevitz wrote:

> Mama Thread (1 of these)
>  a) Release 4 Baby threads to do some work (signal 4 semaphores)
>  b) do some prep work for the next cycle
>  c) Wait for the 5 baby threads to complete (wait on 4 semaphores)
>  d) goto (a)
>
> Baby thread (4 of these)
>  e) Wait for mama to tell them to work (semaphore)
>  f) do the work
>  g) tell mama work is done (semaphore)
>  h) goto (e)
[...]
> j) Three baby threads are started and one remains sleeping/unloved

Have you tried using condition variables?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]