How to stop this race condition more effectively

Sean 'Shaleh' Perry shalehperry at attbi.com
Sat May 11 01:22:29 EDT 2002


On 11-May-2002 Adonis wrote:
> i have these two functions running on seperate threads, but when executed it
> causes a race condition on the system, hogging 100% cpu, i was able to
> alleviate it by inserting a time.sleep(1) function to "slow" it down to
> where its at 0% cpu usage when idle which is what i want, problem solved.
> correct, but i was wondering if it could be optimized more?
> 
> any help would greatly be appreciated.
> 

any of the operating system texts used in college talk about these kinds of
problems.  consumer/producer, dining philosophers, etc.





More information about the Python-list mailing list