Re: About WIN32 threads and awin32

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 04 Jan 2003 15:06:40 +0100

Guido Serassio wrote:

> I have followed the last discussion on aufs threads, so I have a doubt. The
> following is the final code of awin32 squidaio_thread_loop:
>
> done_queue.tailp = &request->next;
> if (!ReleaseMutex(done_queue.mutex)) {
> CloseHandle(cond);
> return 1;
> }
> Sleep(0);
> threadp->requests++;

Hmm.. what is this exacly doing? (the first part).

> Do you think that using Sleep(0) give the same result of the new aufs
> "signal" pipe ?

Not quite.

The signal pipe is about having poll/select terminate their timeout
quickly when the I/O threads signal that an I/O event have completed.

Assuming the fragment above is from the I/O threads I see no function of
the Sleep(0). If there is more requests in the requests queue the I/O
thread should continue executing as far as it gets.

Regards
Henrik
Received on Sat Jan 04 2003 - 07:31:42 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:05 MST