[Vm-dev] NativeBoost / Callbacks and Multithreading (Eliot: This is not just NB, we need you here :P)

Ben Coman btc at openInWorld.com
Sat Apr 18 17:57:47 UTC 2015


On 18/04/2015 3:36 pm, "Esteban Lorenzano" <estebanlm at gmail.com> wrote:
>
> So… “multithread” is a complicated issue. Pharo as most Smalltalks is
designed thinking is as monolithic so if you are trying to make the image
to work in different processes… it will not be easy at all :)

The holy grail of multithreaded seems to be functional programing, where
essentially the benefit comes from threads not modifying global state. The
problem with our monolithic system is that you are often (if not always)
modifying global state.  Worker threads can be written that avoid
explicitly modifying global state, but your worker call a method that calls
a method that calls a method that unnoticed by you modifies global state.
This has been the source of a number of bugs I've hunted down in Pharo
(e.g. Transcript; Monticello repository filter).  You have to dig deep to
notice these and I have wondered if somehow there could be some system help
to make such cases fail-early such that any assignment to any instance
variable generates an exception. You could turn this on for worker threads
to ensure they can't inadvertently affect the monolithic assumptions of the
main system.

Of course the worker threads need to deal with transient global state, but
you are in control writing new code with this in mind -- but it protects
reuse of existing monolithic code.

What would it take to get such a feature?

Cheers -ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150419/67e8ae6e/attachment.htm


More information about the Vm-dev mailing list