ext-pmmpthread icon indicating copy to clipboard operation
ext-pmmpthread copied to clipboard

Race condition on class copying when a thread reads a Threaded object provided from another thread

Open dktapps opened this issue 4 years ago • 0 comments

When PTHREADS_INHERIT_NONE is used (or when a Threaded object is created using a class loaded after thread start), the class has to be copied on the fly by other threads when that Threaded object is read into said threads.

This is problematic because it may lead to races between the two threads, resulting in borked copies and/or segfaults.

This would have to be addressed by having the class copied to permanent storage when assigned to a Threaded member.

dktapps avatar Nov 28 '21 19:11 dktapps