On 5 May 2012 03:11, Igor Stasenko <[email protected]> wrote:
> On 5 May 2012 01:06, Guillermo Polito <[email protected]> wrote:
>> I've just noticed that the following expression:
>>
>>     InMidstOfFileinNotification signal ifFalse: [ ...
>>
>> Is to notice if I'm in the middle of the file in.
>>
>>
> unless there is another process who InMidstOfFilein.
>
> IMO one should use plain boring semaphores and critical section,
> because exceptions have effect on current process, but completely
> ignorant to what happens
> in other ones.
>
> just to test , add the following test:
>
> sema := Semaphore new.
>
> [ sema signal. self fileIn: '20 seconds asDelay wait' ] fork.
>
> sema wait.
> self should: (self fileIn: '20 seconds asDelay wait') raise:

oops, the above is of course should be:

 self should: [self fileIn: '20 seconds asDelay wait'] raise:

but i think you got an idea.

> InMidstOfFileInErrorOrWhatever.
>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> amazing,
>> Guille
>
>
>
> --
> Best regards,
> Igor Stasenko.



-- 
Best regards,
Igor Stasenko.

Reply via email to