[Newbie] Is squeak thread-safe ?

Guillaume Rams guillaume.rams at sema.fr
Mon Dec 20 13:48:08 UTC 1999


Hi,

>
> I am not sure if I understand exactly what you're trying to do.
> It sounds to
> me like you're trying to wrap COM objects in Smalltalk so you'd send a
> message to a COM object that's being passed on to Smalltalk but which will
> in turn call a COM member function?! Is that right?! [I'm
> somewhat confused
> here since I can't really make out what's part of the ST side and what's
> part of COM and who's going to send what message to whom...]
>
>   Andreas

Well, I'm a little bit confused, too. This is just an idea of how it could
be done. Things will surely change when the coding is done.

To tell it another way, the whole mecanism should look something like that :

   IE (scripting host) calls :
squeak ActiveX does :

	parse("document doSomething")----------------------------------> somewhere
store: (BlockClosure with:"document doSomething")
	name("document", aCOMObject)-----------------------------------> somewhere
namespace at: #document put: (factory pleaseWrap:aCOMObject)
	execute--------------------------------------------------------> (somewhere
namespace at: #document) doSomething

Let's pretend that aCOMObject implements IDOMDocument.
1ƒ) If the factory knows a IDOMDocumentWrapper class, it will create a
IDOMDocumentWrapper with: aCOMObject
2ƒ) Else, a IGenericWrapper with: aCOMObject
(Let's not deal with objects that implement more than one interface now.)

Now, if the doSomething message is defined on the instance (be it
IDOMDocumentWrapper or IGenericWrapper), smalltalk VM will handle it "as
usual". If not, the "doesNotUnderstand" error will be intercepted, then try
to dispatch the call to aCOMObject using standard COM mecanism. This is a
behavior on IGenericWrapper, so IDOMDocumentWrapper had better be a subclass
of it.

I am starting implementation, so details will be available when the work
goes further on. Please don't expect too much too early, because I'm doing
it on my spare time. BTW any help is welcome :-)

Guillaume Rams





More information about the Squeak-dev mailing list