[Ecls-list] Make CL:SLEEP enter alertable wait state on win32

Samium Gromoff _deepfire at feelingofgreen.ru
Wed Aug 20 00:20:37 UTC 2008


From: "Juan Jose Garcia-Ripoll" <juanjose.garciaripoll at googlemail.com>
Subject: Re: [Ecls-list] Make CL:SLEEP enter alertable wait state on win32
Date: Tue, 19 Aug 2008 13:41:26 +0200

> On Wed, Aug 13, 2008 at 12:53 AM, Samium Gromoff
> <_deepfire at feelingofgreen.ru> wrote:
> > The patch below makes the CL:SLEEP's wait "alertable", using the
> > win32-speak. [...]
> > A proper patch, I guess, would differ in two aspects -- first, it would
> > change other functions using non-alertable win32 calls to their alertable
> > analogs (if there are any), and second, probably more importantly,
> > it would ensure that CL:SLEEP would sleep no less than asked, which,
> > in the current incarnation, isn't guaranteed.
> 
> Hi Samium, I understand the utility of using SleepEx, but it eludes me
> what you say about Sleep currently sleeping _less_ than it is asked.

I'm sorry I wasn't quite clear -- I contrasted the current patch's behaviour
against "A proper patch", not against the status quo -- my patch
adds a regression, that's what I've meaned to tell.

> Sleep, if I read it correctly in
> http://msdn.microsoft.com/en-us/library/ms686298(VS.85).aspx has the
> same warranties as SleepEx, though the latter may return _earlier_ if
> some of the signalling conditions is met.

Absolutely!

> If this is true, and except for the signals Sleep and SleepEx would
> sleep for the same period of time,

Not for /signals/ per se, but yes

> then I see no need to add new semantics to CL:SLEEP which is not
> existent in other ports,

I would say "in other implementation-OS duplets", as async cross-thread 
intercessions are indeed present as pthread_kill() on most (?)
platforms other than win32.

> or is being implemented in a different form (SERVE-EVENT!!!).

SERVE-EVENT implies a manually managed event-loop, doesn't it?
Asynchronosity of signal-like mechanisms has its advantages, I believe.

Of course, the win32's alertable wait states/APCs are a mere mockery
of UNIX signals...


regards, Samium Gromoff




More information about the ecl-devel mailing list