Squeak: processes and threads

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Squeak: processes and threads

iakovz
Hi,

Where can i find info on processes inside Squeak VM i.e. does it run
only one process or multiple processes are allowed; is it possible to
use threads. i need it in order to make a VM plugin which is heavely
depends on process semantics

(i mean process is UNIX process)

thanks in advance,

with best regards, Yakov Zaytsev <[hidden email]>

PS I'm implementing sort of HA for Squeak on top of QNX HAM system
library. If anyone interested in this topic feel free to mailto:
[hidden email]

It's hard to do because of the fact that HA implies
restarts/suspends/etc of guarded processes..

Reply | Threaded
Open this post in threaded view
|

Re: Squeak: processes and threads

Mathieu SUEN
YAKOV a écrit :

> Hi,
>
> Where can i find info on processes inside Squeak VM i.e. does it run
> only one process or multiple processes are allowed; is it possible to
> use threads. i need it in order to make a VM plugin which is heavely
> depends on process semantics
>
> (i mean process is UNIX process)
>
> thanks in advance,
>
> with best regards, Yakov Zaytsev <[hidden email]>
>
> PS I'm implementing sort of HA for Squeak on top of QNX HAM system
> library. If anyone interested in this topic feel free to mailto:
> [hidden email]
>
> It's hard to do because of the fact that HA implies
> restarts/suspends/etc of guarded processes..
>
>

You can read  

Smalltalk by Example ch. 16 and follow.
http://www.iam.unibe.ch/~ducasse/FreeBooks/ByExample/

But it's base on visual works  even so you can easely make the relation with squeak.

Math

Reply | Threaded
Open this post in threaded view
|

Re: Squeak: processes and threads

Bert Freudenberg
In reply to this post by iakovz
YAKOV wrote:
> Hi,
>
> Where can i find info on processes inside Squeak VM i.e. does it run
> only one process or multiple processes are allowed; is it possible to
> use threads. i need it in order to make a VM plugin which is heavely
> depends on process semantics
>
> (i mean process is UNIX process)

You can fork off as many processes as you like from a plugin, but the
interpreter itself is not reentrant. So any work that those helper
threads do must be synchronously retrieved from the image through your
plugin.

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: Squeak: processes and threads

timrowledge
In reply to this post by iakovz

On 19-Sep-06, at 7:26 AM, YAKOV wrote:

> Hi,
>
> Where can i find info on processes inside Squeak VM

The core VM makes no real use of OS processes or threads. Platforms  
are free to do whatever they need to support the system so long as  
they don't break the core. AIUI windows and mac use OS threads to  
harvest OS events for example. The AsynchFilePlugin pretty much  
expects OS threads of some form to be available to support  
asynchronous file access (duh!) but that is an optional plugin and so  
far as I recall is not much used.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Fractured Idiom:- ALOHA OY - Love; greetings; farewell; from such a  
pain you should never know



Reply | Threaded
Open this post in threaded view
|

Re: Squeak: processes and threads

David T. Lewis
In reply to this post by Bert Freudenberg
On Tue, Sep 19, 2006 at 11:07:22AM -0400, Bert Freudenberg wrote:

> YAKOV wrote:
> >Hi,
> >
> >Where can i find info on processes inside Squeak VM i.e. does it run
> >only one process or multiple processes are allowed; is it possible to
> >use threads. i need it in order to make a VM plugin which is heavely
> >depends on process semantics
> >
> >(i mean process is UNIX process)
>
> You can fork off as many processes as you like from a plugin, but the
> interpreter itself is not reentrant. So any work that those helper
> threads do must be synchronously retrieved from the image through your
> plugin.

An example of this is the fork and exec primitives in UnixOSProcessPlugin
(in the OSProcessPlugin package on SqueakMap). You can do something
similar to initiate pthreads, but in both cases any update back to
the image must be done synchronously as Bert describes. For example,
when an external Unix process that was started by the plugin completes
execution, the plugin notifies the image by means of signaling a
Squeak semaphore. The Squeak process (Smalltalk process) waiting on
the semaphore wakes up "asynchronously" in the image, but this is
happening with the interpreter thread of the VM, which functions
within a single OS process (and pthread, if threads are being used).

You will also need to consider that other parts of the VM and other
plugins may independently do things with threads or processes.
This could affect things like signal handling in surprising ways.

What are you trying to accomplish in your plugin?

Dave