|Perl Monk, Perl Meditation|
Re^3: Fork and creating a thread exits the processby jeffenstein (Friar)
|on Aug 12, 2020 at 08:39 UTC||Need Help??|
>>As to why your code fails? I suspect the use of an XS module that doesn't support multithreading.
>I am not confident that this is correct. Based on my understanding if ithreads, it's not traditional light weight threads (e.g., pthreads), so there is no possibility of the threadsafeness of the shared library being tested. ...
From the threads documentation:
Since Perl 5.8, thread programming has been available using a model called *interpreter threads* which provides a new Perl interpreter for each thread, and, by default, results in no data or state information being shared between threads.
So, perl threads are just a thin layer over the C interface to the OS implementation of threads, with the heavyweight copy-everything step added. There's nothing I see there that would cause a previously thread-safe library to no longer be thread safe.
>There seems to be a severe lack of familiarity in the Perl community with what "real" threads are wrt "multithreading". No doubt this is not lost of many, but I continue to see over and over again the suggestion that Perl ithreads are related to traditional shared memory threads. This is simply not the case.
Lack of familiarity with the concept of "threads" or lack of familiarity with a particular implementation of "threads"? The concept of threads is easy, but threads are hard to use for everyone, unless someone has already abstracted it away for them.