Hacker News new | past | comments | ask | show | jobs | submit login

> Also, the Squeak VM has (IIRC) limited ability to make use of true parallelism.

The Squeak VM is single-threaded, OS-wise, so it's just green threads. I don't even honestly remember to what extent its green threads are preemptive; I do remember that anything hitting C would pause other threads until it concluded, though, which made it really important to make sure that e.g. your database driver was 100% Smalltalk so it wouldn't lock the VM constantly.




Kinda. The VM executes Smalltalk on a single thread (interpreting or running JIT-compiled code). At the Smalltalk level, the unit of concurrency is called a "process". Processes are assigned priorities. Processes with higher priority preempt processes of lower priority, but processes of the same priority are cooperative.

So yes, "green threads". However, the VM does run multiple OS threads. When a Smalltalk process does IO, that gets performed on a different OS thread by the VM and the calling Smalltalk process is blocked, which lets another Smalltalk process get scheduled.

You could do that trick for things like calling ODBC or computationally expensive C code, but if you just call single-threaded C code directly, yeah, it'll block all Smalltalk processes until it returns.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: