
7 Jul
2010
7 Jul
'10
2:27 p.m.
De: Lloyd
Now I will explain the real problem. There is a data write (to the disk) handler routine. If the disk is full I want the thread to wait until some disk space is free.For this what I do is, in the write handler there is a infinite while loop. Inside this thread interruption is enabled. The it checks for free space in the disk. If it is available, it breaks the while. Other wise it sleeps for some time, continues in the loop. Is there a better way to handle this?
When the handler fails because of a disk full, it could, instead of entering a loop, schedule a timer and return immediately. When the timer fires, its handler would retry the write.