> >Can the home-grown version be made threadsafe? Is it threadsafe? > (Does anyone care?) > > The home-grown version does begin its argument list with pTHX_. I > will try to read up in the threading docs and see if there's anything > else we should be doing that we're not, such as locking around > certain bits of code. I'm not that experienced in this area so if Threadsafety of readdir(_r) probably should make the data structure received from opendir() and iterated over by readdir() cloned (or at least clone the "current entry pointer") into the thread local data storage of each thread so that alternate threads don't get a random selection of directory entries. (Of course, the directory contents could change while the code is executing, but that's the case even with singlethreaded code). > anyone has specific suggestions they are welcome. -- Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special biologist word we use for 'stable'. It is 'dead'." -- Jack CohenThread Previous | Thread Next