Semaphore>>wait:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Semaphore>>wait:

Pieter Emmelot-2
Dear ObjectArtists,
According to the method comment of #wait:ret: you are not allowed to
specify a timeout other then INFINITE or 0.
Does this (still) apply (to Win2K or XP)? And if yes, why?
Guessing from the constants the actual work is performed by a
WaitForSingleObject API call and that one does support millisecond
timeouts.
Or am I missing something?


Pieter Emmelot


Reply | Threaded
Open this post in threaded view
|

Re: Semaphore>>wait:

Blair McGlashan
"Pieter Emmelot" <[hidden email]> wrote in message
news:[hidden email]...
> Dear ObjectArtists,
> According to the method comment of #wait:ret: you are not allowed to
> specify a timeout other then INFINITE or 0.
> Does this (still) apply (to Win2K or XP)? And if yes, why?
> Guessing from the constants the actual work is performed by a
> WaitForSingleObject API call and that one does support millisecond
> timeouts.
> Or am I missing something?
>

The timeout parameter is reserved for future use as stated in the method
comment, sorry.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Semaphore>>wait:

Pieter Emmelot-2
>>Dear ObjectArtists,
>>According to the method comment of #wait:ret: you are not allowed to
>>specify a timeout other then INFINITE or 0.
>>Does this (still) apply (to Win2K or XP)? And if yes, why?
>>Guessing from the constants the actual work is performed by a
>>WaitForSingleObject API call and that one does support millisecond
>>timeouts.
>>Or am I missing something?
>>
>
>
> The timeout parameter is reserved for future use as stated in the method
> comment, sorry.
>
> Regards
>
> Blair
>

Is it ok to subclass Semaphore (with instance variable)?


Reply | Threaded
Open this post in threaded view
|

Re: Semaphore>>wait:

Blair McGlashan
"Pieter Emmelot" <[hidden email]> wrote in message
news:[hidden email]...

> >>Dear ObjectArtists,
> >>According to the method comment of #wait:ret: you are not allowed to
> >>specify a timeout other then INFINITE or 0.
> >>Does this (still) apply (to Win2K or XP)? And if yes, why?
> >>Guessing from the constants the actual work is performed by a
> >>WaitForSingleObject API call and that one does support millisecond
> >>timeouts.
> >>Or am I missing something?
> >>
> >
> >
> > The timeout parameter is reserved for future use as stated in the method
> > comment, sorry.
> >
> > Regards
> >
> > Blair
> >
>
> Is it ok to subclass Semaphore (with instance variable)?

No, it is not safe to subclass Semaphore. The VM sometimes checks
specifically for the class. However you can always use has-a instead of
is-a, and wrap up Semaphore inside another class as is done by Mutex.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Semaphore>>wait:

Schwab,Wilhelm K
Pieter,

> No, it is not safe to subclass Semaphore. The VM sometimes checks
> specifically for the class. However you can always use has-a instead of
> is-a, and wrap up Semaphore inside another class as is done by Mutex.

I'm starting to suspect that you are working on a (hopefully) solve
problem, if only in part.  Take a look at the timed evaluators on my web
site.  Feel free to use the code as-is or change it as necessary, but
please let me know if you find any bugs.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Semaphore>>wait:

Pieter Emmelot-2
Bill Schwab wrote:

> Pieter,
>
>> No, it is not safe to subclass Semaphore. The VM sometimes checks
>> specifically for the class. However you can always use has-a instead of
>> is-a, and wrap up Semaphore inside another class as is done by Mutex.
>
>
> I'm starting to suspect that you are working on a (hopefully) solve
> problem, if only in part.  Take a look at the timed evaluators on my web
> site.  Feel free to use the code as-is or change it as necessary, but
> please let me know if you find any bugs.
>
> Have a good one,
>
> Bill
>
I made a Dolphin package of Chuan-kai Lin's MesaMonitor code for Squeak.
Now I need time-out functionality and I'm looking for a clean and simple
way.
Anyway thanks for the pointer Bill, I will take a look.

  - Pieter