[Pharo-dev] Multithreading

Clément Bera bera.clement at gmail.com
Wed Nov 20 14:58:28 EST 2013


So what you are looking for is Process and semaphores.

This is not multithreading in the default Pharo VM + image, currently our
semaphore/process management is not multithreaded, but executes all the
process in the same thread. What happens basically is that you will run
several processes in 1 thread with different priorities, and processes with
highest priorities will be executed first. This is very good for your case,
because if you put your task in another process with lower priority than
the UI process, each time you will trigger a UI interaction the secondary
process will be temporarily stopped to execute your UI interaction.

(see #forkAt: Process userBackgroundPriority)

Seemingly there's no chapter about Process and semaphores yet but Stef is
planning to write one.

The other alternatives are to use CogMT, a version of the Cog VM with real
multithreading for FFI (but I think it will not work easily with your case)
or the island VM plugin, which seemingly is an actor based multithreading
system in Squeak/Pharo (however there is only 1 project that successfully
uses it, which is the one of 3DICC).




2013/11/20 Yuriy Tymchuk <yuriy.tymchuk at me.com>

> I’m not proficient in multithreading, but I think that I’m looking
> for Semaphore and Process. Things that I implement take a very long time to
> run, and I can’t do anything else during that time or even cancel them. So
> I guess they should run in a separate process which I can achieve with
> #fork. But as I start to work with that I want to know all the rest that
> can be useful.
>
> uko
>
> On 20 Nov 2013, at 19:21, Clément Bera <bera.clement at gmail.com> wrote:
>
> Hello,
>
> What do you mean by multithreading ?
> Do you mean Semaphore and Process, Cog Multithreading, the Island VM
> plugin ?
>
>
> 2013/11/20 Yuriy Tymchuk <yuriy.tymchuk at me.com>
>
>> Hi everyone, is there any chapter on multithreading in Pharo books? If
>> not maybe I’ll write something about that, but any material will be useful
>> for me right now.
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131120/993ff773/attachment-0002.html>


More information about the Pharo-dev mailing list