[squeak-dev] OSProcess question

Trygve Reenskaug trygver at ifi.uio.no
Tue Mar 11 10:18:42 UTC 2008


Dear Hans-Martin,
I was very happy to see your advice. My process is hanging in /<(Delay 
forMilliseconds: 1200) wait/>, perhaps this could help..

I do not understand the meaning of   </OSProcess waitForCommand:/>
I have looked in Squeak  3.8 and 3.10.
    Neither image has the global constant </OSProcess/>.
    Neither image has implemented the method </waitForCommand:/>.

Does this only apply to a particular platform? (I run WinXP)
Could you please enlighten me?

Cheers
--Trygve


On 11.03.2008 08:24, Hans-Martin Mosner wrote:
> David T. Lewis schrieb:
>   
>> On Mon, Mar 10, 2008 at 11:13:42AM -0700, Andreas Raab wrote:
>>   
>>     
>>> We have a situation where some code reliably locks up when used like here:
>>>
>>>  p := OSProcess command: 'chmod +x ', path.
>>>  [p isComplete] whileFalse.
>>>
>>> This hangs quite reliably in the second line and I'm *assuming* that we 
>>> need to yield/delay execution while waiting. Is this correct? I was 
>>> trying to trace through the code paths which update the runState but it 
>>> wasn't immediately clear where this comes from.
>>>     
>>>       
>> Hi Andreas,
>>
>> Yes, you should add a delay in the loop, or use this (which adds the
>> delay for you):
>>
>>   p := OSProcess waitForCommand: 'chmod +x ', path
>>
>> The run state of an external OS process is updated by a separate Squeak
>> process (evaluate "OSProcess accessor grimReaperProcess"), so you need
>> to wait for the grimReaperProcess to react to the external process
>> exit notification.
>>     
> This sounds like the grimReaperProcess should be given higher priority
> so it would not be starved by a busy-waiting foreground process.
> I'd suggest at least Processor lowIPPriority.
>
> Cheers,
> Hans-Martin
>
>
>   

-- 

Trygve Reenskaug       mailto: trygver at ifi.uio.no

Morgedalsvn. 5A         http://heim.ifi.uio.no/~trygver

N-0378 Oslo               Tel: (+47) 22 49 57 27

Norway

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080311/41980236/attachment.htm


More information about the Squeak-dev mailing list