About WIN32 threads and awin32

From: Guido Serassio <serassio@dont-contact.us>
Date: Sat, 04 Jan 2003 12:37:08 +0100

Hi,

I need an opinion on awin32 (Robert's native WIN32 aufs clone) threads
handling:

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++;

On MSDN I read:

VOID Sleep(
   DWORD dwMilliseconds // sleep time
);
Parameters
dwMilliseconds
[in] Specifies the time, in milliseconds, for which to suspend execution. A
value of zero causes the thread to relinquish the remainder of its time
slice to any other thread of equal priority that is ready to run. If there
are no other threads of equal priority ready to run, the function returns
immediately, and the thread continues execution. A value of INFINITE causes
an infinite delay.

Remarks
A thread can relinquish the remainder of its time slice by calling this
function with a sleep time of zero milliseconds.

So, my question is:

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

Regards

Guido

-
=======================================================
Serassio Guido
Via Albenga, 11/4 10134 - Torino - ITALY
E-mail: guido.serassio@serassio.it
WWW: http://www.serassio.it
Received on Sat Jan 04 2003 - 04:37:37 MST

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