semaphore question

semaphore question

Post by sancelo » Wed, 12 Jan 2000 04:00:00



I would be aple to share semaphore between processes.

I tried sem_open for use of named sempahores, but it did not worked ,
errno = Function not implemented .

What is the best way to communicate via events between processes at this
time, on linux

thanks for help

steph

 
 
 

semaphore question

Post by Kaz Kylhe » Wed, 12 Jan 2000 04:00:00



>I would be aple to share semaphore between processes.

>I tried sem_open for use of named sempahores, but it did not worked ,
>errno = Function not implemented .

Correct. LinuxThreads does not implement named semaphores. In fact, it does not
implement any process-shared synchronization objects at all, such as
process-shared mutexes or process shared condition variables.

Quote:>What is the best way to communicate via events between processes at this
>time, on linux

Traditional mechanisms such as pipes, sockets, System V IPC.

 
 
 

semaphore question

Post by Damir Cosi » Wed, 12 Jan 2000 04:00:00



> I would be aple to share semaphore between processes.

> I tried sem_open for use of named sempahores, but it did not worked ,
> errno = Function not implemented .

> What is the best way to communicate via events between processes at this
> time, on linux

> thanks for help

> steph

try semget(), semop(), semctl()

Damir Cosic

 
 
 

semaphore question

Post by fernand » Thu, 13 Jan 2000 04:00:00


It depends what you want to do.
If you still have the problem, please send some detailed info.


> I would be aple to share semaphore between processes.

> I tried sem_open for use of named sempahores, but it did not worked ,
> errno = Function not implemented .

> What is the best way to communicate via events between processes at this
> time, on linux

> thanks for help

> steph

--
---------
Real e-mail: sanabriaf at yahoo dot com
This are my personal opinions
 
 
 

1. semaphore questions, two different ones

I'm trying to use semaphores for the first time, mainly using Stevens (Adv.
Prog. in Unix Env) as reference.  I initially thought it was pretty
straight-forward, but I'm having some problems that I don't understand...

1. I created a semaphore successfully, but in my shutdown routine I want to
release to release the semaphore.  I initially was trying to use semop(...
IPC_RMID), but this fails with "invalid argument".  Based on an example
elsewhere on the web, I instead used semctl(... IPC_RMID)... this succeeded,
but I noticed that on subsequent semaphore acquisitions (when I reload my
daemon), the semaphore number is jumping by about 120 per load.  I expected
it to increase by one at each instance, didn't I??  Why is this happening??
And what do I have to put in the sembuf struct if I want to use semop() for
this purpose??

2. In any case, what I'm trying to do with the semaphore is prevent
simultaneous access to a data struct in my daemon, if it's accessed several
times in close succession (which it is...).  In a device driver, I'd just
use cli()/sti() to access a mutex flag, but I can't do that in a daemon; are
semaphores the appropriate method for doing this, or is there some better
way??

2. How to implement "screenblank" ?

3. Semaphores - question about "ftok"

4. fix max PCI bus number

5. Semaphore question???

6. Location for GCC Libs?

7. Semaphore Question

8. dual boot partitioning method

9. Semaphores question; Why sleep if sem != 0 ?

10. semaphore question

11. POSIX.4 Semaphore questions

12. Semaphore questions

13. Semaphore question.