Lately I've been trying out new (to me) languages and one of the things I
keep running into is "fake" threading support, i.e. the threads are "real"
in the sense they can preempt one another and map to native OS threads, but
in practice they can't actually run at the same time so there is no
parallel speedup (concurrency, not parallelism). Python has the GIL, and
Racket has futures that technically can run simultaneously but only as long
as no thread allocates -- which is a pretty big limitation since so much as
sneezing in Lisp causes an allocation. Python also has the multiprocessing
library which works in for some problems but not others and Racket has the
places mechanism which is almost identical and has the same limitations.

What is the state of multithreading in Perl 6 (MoarVM)? Specifically:

* Can two threads preempt one another?
* Is there a GIL? (Think I asked around before and the answer is no)
* Can two threads allocate at the same time?
* Does a GC stop all threads?
* Are there any other common operations, besides allocation, that trigger
locks?
* If allocation triggers a lock, how feasible is it to write in an
allocation free style?

Hyper operators and junctions and future promises of autothreading are
great, but without answers to these it's hard to know whether the threading
is or will be actually worth taking advantage of. I've noticed nobody
outside the CLR and the JVM seems to actually implement real multithreaded
GC so I'm a bit skeptical. It seems like a common implementation stumbling
block and a genuinely hard problem.

Joe G.

Reply via email to