wait until change
Matthew Wilson
mwilson at sarcastic-horse.com
Fri Oct 17 15:48:19 EDT 2003
I just took a midterm in my operating systems class, and a big topic was
"busy waiting" and semaphores.
And now, today, a real-world example! Anyway, the time.sleep() method
is probably good enough, but how would a semaphore solution work in
python? A semaphore solution is one where the process that uses the
updated file is asleep until another process says "Hey! Wake up! I
updated the file!". This avoids all those check_for_update() calls
which bog down the CPU.
Anyone?
More information about the Python-list
mailing list