Library to use multi-core in Pharo?

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

Library to use multi-core in Pharo?

Pharo Smalltalk Users mailing list
Hi!

Is there an effort to easily use multi-core or native processes in Pharo?
I am thinking about a library that offer a construct like:

future := Runner runInDifferentProcess: [ “This block is run in a different OS process” ]

That would save the image under a different name, use OSSubProcess to launch a new Pharo with no UI.

Is there a library available?

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Library to use multi-core in Pharo?

hernanmd
Hi Alex,

I think you could launch jobs using GNU parallel, otherwise for shared memory parallelism OpenMP is a common choice.
There is an old thread: http://forum.world.st/NativeBoost-and-OpenMP-td4837865.html but no library AFAIK

Cheers,

Hernán


El mié., 9 ene. 2019 a las 16:56, Alexandre Bergel via Pharo-users (<[hidden email]>) escribió:
Hi!

Is there an effort to easily use multi-core or native processes in Pharo?
I am thinking about a library that offer a construct like:

future := Runner runInDifferentProcess: [ “This block is run in a different OS process” ]

That would save the image under a different name, use OSSubProcess to launch a new Pharo with no UI.

Is there a library available?

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Library to use multi-core in Pharo?

Thierry Goubier
In reply to this post by Pharo Smalltalk Users mailing list
Hi Alexandre,

look at taskit: (https://github.com/sbragagnolo/taskit). I think it
can do what you are looking for. I think that OSProcess is also able
to do that via fork calls.

Having minimal, light weight images without complex loading
preferences and whatever would help, otherwise simply forking your
current image could be faster.

Thierry

Le mer. 9 janv. 2019 à 19:42, Alexandre Bergel via Pharo-users
<[hidden email]> a écrit :

>
> Hi!
>
> Is there an effort to easily use multi-core or native processes in Pharo?
> I am thinking about a library that offer a construct like:
>
> future := Runner runInDifferentProcess: [ “This block is run in a different OS process” ]
>
> That would save the image under a different name, use OSSubProcess to launch a new Pharo with no UI.
>
> Is there a library available?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Library to use multi-core in Pharo?

Thierry Goubier
Oh well, sorry. I checked and ... it seemed taskit could do it, but
now it seems to be a future extension.
However OSProcess can do it: look at #forkSqueak.

Thierry

Le mer. 9 janv. 2019 à 21:36, Thierry Goubier
<[hidden email]> a écrit :

>
> Hi Alexandre,
>
> look at taskit: (https://github.com/sbragagnolo/taskit). I think it
> can do what you are looking for. I think that OSProcess is also able
> to do that via fork calls.
>
> Having minimal, light weight images without complex loading
> preferences and whatever would help, otherwise simply forking your
> current image could be faster.
>
> Thierry
>
> Le mer. 9 janv. 2019 à 19:42, Alexandre Bergel via Pharo-users
> <[hidden email]> a écrit :
> >
> > Hi!
> >
> > Is there an effort to easily use multi-core or native processes in Pharo?
> > I am thinking about a library that offer a construct like:
> >
> > future := Runner runInDifferentProcess: [ “This block is run in a different OS process” ]
> >
> > That would save the image under a different name, use OSSubProcess to launch a new Pharo with no UI.
> >
> > Is there a library available?
> >
> > Cheers,
> > Alexandre
> > --
> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> > Alexandre Bergel  http://www.bergel.eu
> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >
> >
> >

Reply | Threaded
Open this post in threaded view
|

Re: Library to use multi-core in Pharo?

Pharo Smalltalk Users mailing list
In reply to this post by Pharo Smalltalk Users mailing list
On Wed, Jan 09, 2019 at 01:18:45PM -0300, Alexandre Bergel via Pharo-users wrote:
> Is there an effort to easily use multi-core or native processes in Pharo?
> I am thinking about a library that offer a construct like:

There used to be a Hydra VM for Squeak:

  http://squeakvm.org/~sig/hydravm/devnotes.html

From the developer notes: A HydraVM encapsulates full interpreter state
in single object. This allowing it to support as many as needed
interpreter instances to be run using different native threads. Most of
VM functions (and all primitives) now require an additional argument -
interpreter instance.

Pierce


Reply | Threaded
Open this post in threaded view
|

Re: Library to use multi-core in Pharo?

Pharo Smalltalk Users mailing list
In reply to this post by Pharo Smalltalk Users mailing list


On Thu, 10 Jan 2019 at 00:19, Alexandre Bergel via Pharo-users <[hidden email]> wrote:
Hi!

Is there an effort to easily use multi-core or native processes in Pharo?
I am thinking about a library that offer a construct like:

future := Runner runInDifferentProcess: [ “This block is run in a different OS process” ]

That would save the image under a different name, use OSSubProcess to launch a new Pharo with no UI.

Is there a library available?

maybe not the full answer you were hoping for, but just you a side thought...

One thing I've been curious about for a while is how the system might behave 
if via FFI you call fork() or clone(), and use Kilon's CPP Bridge [1] for return values.


cheers -ben