first patch for process-shared semaphore

David Xu davidxu at freebsd.org
Tue Dec 29 09:24:37 UTC 2009


Alexander Kabaev wrote:

>>> May I can move all semaphore functions into libc and remove all
>>> semaphore related symbols from libthr ? In pratical, this is not a
>>> problem, because libthr itself is not dlopen-safe, all missing
>>> semaphore functions in libthr will be found in libc by rtld.
>> I would go with this approach.  There is also some discussion about
>> moving all of libthr into libc as well and having a dummy libpthread
>> now that we are back to a single threading library and to avoid
>> issues with dlopen() of libpthread, etc.
>>
> 
> Removing symbols from library, versioned library especially, is a big 
> wrong. You should provide compat symbols for all functions that that
> were there before.  
> 

I have updated the patch:
http://people.freebsd.org/~davidxu/patch/shared_semaphore_2.patch

this time, all semaphore code are moved into libc and libthr still
has semaphore stubs.

Also, now semaphore file is created in /tmp as name SEMD<name>,
this looks like Solaris does as jhb@ said, though the patch doesn't
use lock file, but use the semaphore file itself.





More information about the freebsd-threads mailing list