Re: Native thread support

Andreas Rosenberg <[email protected]> Fri, 11 Feb 2022 17:21:31 +0100
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
Greetings,

just a few thoughts regarding multi-threading support. In my job, I'm
maintaining the
VM source code of the Digitalk Smalltalk VM. I have made some
considerations how
Smalltalk could support native multi-threading and there are a lot of
hurdles to overcome:

- the garbage collector: also a multi-threaded garbage collector is
required, which is quite
   complex. Each thread needs at least it's own "short term object
heap". Even in Java a full GC
   requires a "world stop" and each thread must have reached a so called
"safe point" to make
  a full GC work. This requires special means of synchronization for
each thread.

- the language needs new keywords to deal with synchronization issues.

- many base classes must be rewritten to be thread safe

- probably a lot of other problems may exist, that are not visible in
the first place

To my knowledge currently no Smalltalk implementation exists, which can
do multi-threading.
The basic design was done in the 70ties and early 80ties and
multi-threading has not
been considered during that era.

Afaik only Java and C# have a VM that supports automatic garbage
collection with multiple native
threads. I don't know about C#, but the team working on JDK is about 580
people (at least
this is number of different committers on the github project).
Imho a considerable effort is needed, which would only be done, if there
is a "strong need"
and a team of clever people who might achieve this.

Smalltalk is only a niche system and the user base is declining more and
more,
so I hardly see any reason, why anybody would invest in such a project.

Best regards,

Andreas

On 05.02.2022 21:09, Blake McBride wrote:
> Greetings,
>
> One of the things that have kept me from all Smalltalks is the lack of
> true/native multi-threading support that is able to utilize multiple CPUs.
> In today's world, it is a show-stopper for me and many others.
>
> I believe that GST only supports cooperative threads utilizing a single
> machine thread.  Adding true native thread support would make GST quite
> appealing to a large crowd IMO.  I'd also guess that adding said support
> would be difficult but easier in GST than other Smalltalks.
>
> Just a thought.
>
> Thanks!
>
> Blake McBride