POSIX Thread Safe Semaphores & FreeBSD questions

POSIX Thread Safe Semaphores & FreeBSD questions

Post by Bill Maniatt » Thu, 27 Nov 1997 04:00:00



Hello All:

I am trying to do the following on a FreeBSD platform using their
subset of POSIX threads.  The problem lies in that I have an application
library which does file management and uses among other things,
semaphores.
I would to use this library in an executable with a multithreaded
streaming
socket library, but there is a problem here.

The rub lies in that the Unix system V library semaphores provided by
FreeBSD do not seem to be thread safe.

By this I mean is that they seem to suspend the entire process
(rather than just the currently executing thread).

The POSIX thread safe semaphores are NOT installed
(and as far as I know not supported for that architecture).

1) What level of POSIX compatibility is associated with the current
        stable FreeBSD release with regards to POSIX Threads?

2) Is thread safe semaphore support necessary for POSIX standards
compliance?

3) What level of compliance doe FreeBSD POSIX have with regards to
pthreads?

4) Is there a mechanism for (POSIX) pthread safe semaphores available
        for FreeBSD?

5) If not, is there a work around I can use to emulate the semaphore's
        semantics?

Thanks for taking these questions seriously.

Regards:

Bill Maniatty

 
 
 

1. trigger functions in different threads && thread_join for posix threads

I need a way to have one thread force another thread to
call a routine.  I'd prefer not jumping into a while loop
and polling a flag variable.  Is there anything similar to
a callback that I could use for this purpose?  An event
handler?  (and if so, how would I go about that?)

As noted in an earlier message, this is to work around
the fact that prior to X11R6, child threads can't
manipulate the display.

Also, in Solaris there were both "pthreads" and "threads."
The thread_join command allowed you to wait for ANY thread
to complete by using NULL as the target thread.  Unfortunately,
compiling this code on HP isn't going to work, since it
supports only POSIX threads.  Is there a similar trick that
can be used with POSIX threads?  (Note that I don't want to
wait for all of the threads to complete, just any arbitrary
thread so that I can start up a new thread again.)

Brent Burkholder

2. Newsreading in Linux/X

3. Solaris 8 threads: If a routine is Async-Signal-Safe is it also thread Safe?

4. lexmark x74

5. Wanted: LRU or LRR cache - Posix thread safe

6. iptables and smtp relaying

7. How do I use semaphore to block POSIX threads?

8. using getty to do remote login?

9. Using semaphores to block POSIX threads

10. POSIX threads, thread-specific data: what about the "main" thread?

11. Sys V Semaphores vs. POSIX Semaphores??

12. %!@# Help Posix semaphores & mmap

13. Solaris 2.6: 'Async safe' implies 'thread safe' ?