[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Context switching woes
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
wake up next queued thread
remove thread from queue
end if
end if
end if
sleep for a short time
You could easily modify that to wait for a thread to be locked before waking
up another thread...
The Infamous Mark 'Nurgle' Collins
Lead Author - 'Linux Game Programming' (ISBN: 0-7615-3255-2)
WWW: http://www.thisisnurgle.org.uk Mobile: +44 7761 774 152
Email: me@thisisnurgle.org.uk Spam: spam@thisisnurgle.org.uk
----- Original Message -----
From: Jarda Benkovsky <pvt.benkovsk@pvtnet.cz>
To: <linuxgames@sunsite.dk>
Sent: Monday, February 19, 2001 11:43 AM
Subject: Re: Context switching woes
> Speaking of the synchronisation, I need this effect - I need to wait in
> one thread until some mutex is locked by other thread. How can I do
> that? Is it possible at all?
>
> Jarda Benkovsky
---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.dk
For additional commands, e-mail: linuxgames-help@sunsite.dk