3 ms·
To be fair at least towards #1, that's a really difficult one to get right. Perl has had that kind of threading for a long time and it's almost always consider
by simcop2387 9y ago
To be fair at least towards #1, that's a really difficult one to get right. Perl has had that kind of threading for a long time and it's almost always considered a bad decision to try to use them. I'm sure it could be done better, but perl did it via a complete copy on write setup in order to create the mostly non-shared data. But you end up with a lot of locking and other contention for the shared data because there's no good way to expose the fact that it's shared and changing it requires such restrictions. Instead the method usually used is to take advantage of most OS's built in COW when forking a new process and communicating via sockets, or some other method instead that forces you to deal with the limitations (copying data, or if you used shared memory you have to do explicit sharing and locking/serialization yourself).