Win32 programming advice needed for OSProcess port

PhiHo Hoang phiho.hoang at rogers.com
Sat Feb 23 20:23:32 UTC 2002


Hi David,

	Thanks for bringing OSProcess to Windows. I always wanted to try
HUGS with 'The world's smartest i/o device for Haskell' but never had
the time to do it myself.

	Please keep up with the good work.

	Cheers,

	PhiHo.

	P.S: My bookmark to www.numeric-quest.com/haskell/Hugs.st seems
no longer online.
	Does any one happen to have a copy I can borrow ? Thanks. 

-----Original Message-----
From: squeak-dev-admin at lists.squeakfoundation.org
[mailto:squeak-dev-admin at lists.squeakfoundation.org] On Behalf Of David
T. Lewis
Sent: Saturday, February 23, 2002 11:59 AM
To: squeak-dev at lists.squeakfoundation.org
Subject: Re: Win32 programming advice needed for OSProcess port


On Wed, Feb 20, 2002 at 10:52:14AM -0500, David T. Lewis wrote:

Thanks to Mark Schwenk, David Chase and Craig Latta for helpful
suggestions on my question about how to get Win32 to notify Squeak when
an external Win32 process exits.

This is probably not of general interest, but for what it's worth here
is the design I ended up implementing (after a few false starts). It
seems to be working fine so far. From the class comment of
WindowsProcess:

When external processes are created, they are added to my allMyChildren
collection, and a thread is created to wait for any of them to exit
using a call to WaitForMultipleObjects() function. This thread is held
by my childWatcherThread instance variable while the thread is active,
and is also added to my threads collection.

Whenever a child process exits, the childWatcherThread will signal a
Semaphore (a Smalltalk Semaphore, not a Windows semaphore), then exit. A
Squeak process in my processAccessor waits on this Semaphore, and sends
an 'update: #childProcessStatus' message to me. In response to this, I
update the status of my active child processes, one or more of which
will have exited. If any of my child processes are still active, I set a
new childWatcherThread to wait for them to exit.

Dave





More information about the Squeak-dev mailing list