[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Context switching woes



Mark Collins wrote:
> 
> I'm plan on having a thread management thread (which won't ever be locked)
> to wake up threads...
> 
> Something like this... (pseudocode)
> 
> for each lockable resource
>     if not locked
>         if thread waiting
          ^^^^^^^^^^^^^^^^^
But that's just the heart of my question :( How to test if given thread
is waiting on mutex? Or, vice versa, since each process will have it's
own mutex, how to test that there's a thread waiting for given mutex?

> sleep for a short time

But this will increase either load or latency or both :(. I would prefer
the scheduling thread be woken up by releasing it's mutex by the thread
just going to sleep. I need cooperative context multitasking. If you
need, I can elaborate more

					Jarda Benkovsky

---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.dk
For additional commands, e-mail: linuxgames-help@sunsite.dk