Soeren wrote:
> Hi max
>
> Thank's for your answer.
>
>   
>> Or did I misunderstand your question?
>>     
>
> Sorry, I think so.
>
> I've read Solaris10 supports POSIX and SystemV Semaphores, and I don't know 
> which Semaphore(s) is using by default.
> Which command can display/report that?
>
> With "ipcs" you can see the opened Semaphores and with "getconf -a|grep -i 
> sem" you can see the limits of SystemV and Posix Semaphores.
>
> Many thanks in advanced!
>  Soeren
>  
>   
No semaphores are used "by default".  Usage of the different semaphores 
available on the system is up to the application.  In other
words, there is no "generic semaphore".  If an application wants to use 
System V semaphores, it calls the appropriate routines, semget(2), 
semop(2), semctl(2).  If an application wants to use Posix semaphores, 
again it calls the appropriate routines,
it calls sem_init(3RT), sem_post(3RT), sem_wait(3RT), etc.  There is a 
third choice using solaris threads (see semaphore(3C)).
There is nothing to keep an application from using all three mechanisms, 
though for a given semaphore, you could not use, say semget(2) to create 
it, and then sem_wait(3RT) to decrement it.

As far as which mechanism an application should use, that depends on 
what you are trying to do.  The Posix and solaris semaphores should be 
fastest, but the System V semaphores allow for some additional 
functionality, notably the ability to operate on a set of semaphores 
with one call, and an "undo" feature that cleans up on exit.

max


max


_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to