[Newbie] Is squeak thread-safe ?

Stephan Houben stephan at pcrm.win.tue.nl
Thu Dec 16 15:48:30 UTC 1999


On Thu, Dec 16, 1999 at 03:56:57PM +0100, Guillaume Rams wrote:
> Hi all,
> 
> 	I want to know if the squeak interpretor is thread-safe. 

The squeak VM doesn't use threading facilities from the operating system.
It implements its own "threads" in user space.

> Because I would
> like to compile it as an ActiveX that implements the IActiveScript interface
> (WIN32 platform specific, sorry). Such ActiveX are interpretors for
> scripting langages in IE or windows scripting host. Microsoft provides DLLs
> for JScript and VBScript, but they don't fit well with heavy-scripted pages
> on the client-side and someone has made a PERL implementation also. Using
> squeak would enable scripting like this I guess :
> <SCRIPT language="squeak">
> 	(NodeList with: (document tags: "DIV")) do: [:t | t innerHTML:
> "<H1>Foobar</H1>"]
> </SCRIPT>
> 

Is this supposed to be executed on the client?
That would open huge security holes, you know...

> This raises a few questions :
>  - is the interpretor thread-safe ?
>  - can the image be stripped easily of all display-related stuff ?

On *nix, you can compile with the HEADLESS option. Then all the X stuff
gets excluded. For thrills, I ran the C file that implements the display
stuff through the standalone C preprocessor with -DHEADLESS so as to
filter out all the X stuff. (But I changed all '#include''s into
'%include's, and then changed them back afterwards, to keep the source
readable.) The result was
a pretty clean headless-only source file, which even managed to compile
into a working (headless) interpreter. You could do the same, or contact
me by private mail if you want my version of the file. Then you have to
integrate the result with the Windows sources, or you could compile
the *nix code with something like the Cygnus tools & libraries.

>  - how do I wrap an external COM object into a squeak object ?

Pardon the ignorance: what is COM?

Stephan





More information about the Squeak-dev mailing list