Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

posix semaphore support?

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


ndbecker2 at gmail

Aug 29, 2008, 1:49 PM

Post #1 of 5 (55 views)
Permalink
posix semaphore support?

Is there a posix semaphore wrapper for python?

Would that be a good addition?

--
http://mail.python.org/mailman/listinfo/python-list


lists at cheimes

Aug 29, 2008, 2:52 PM

Post #2 of 5 (49 views)
Permalink
Re: posix semaphore support? [In reply to]

Neal Becker wrote:
> Is there a posix semaphore wrapper for python?
>
> Would that be a good addition?

The threading module provides a high level interface to native
semaphores, e.g. pthread.

Christian

--
http://mail.python.org/mailman/listinfo/python-list


ndbecker2 at gmail

Aug 29, 2008, 3:48 PM

Post #3 of 5 (49 views)
Permalink
Re: posix semaphore support? [In reply to]

Christian Heimes wrote:

> Neal Becker wrote:
>> Is there a posix semaphore wrapper for python?
>>
>> Would that be a good addition?
>
> The threading module provides a high level interface to native
> semaphores, e.g. pthread.
>
> Christian
>

Does that provide semaphores between unrelated processes?

--
http://mail.python.org/mailman/listinfo/python-list


lists at cheimes

Aug 29, 2008, 4:27 PM

Post #4 of 5 (45 views)
Permalink
Re: posix semaphore support? [In reply to]

Neal Becker wrote:
> Does that provide semaphores between unrelated processes?

No, it just provides unshared semaphores. You can either create your own
Python extensions or you can use ctypes if you need a shared or named
semaphore.

Depending on your requirements you can choose between sem_init() or
sem_open() from semaphore.h or the IPC API from sys/sem.h.

Christian

--
http://mail.python.org/mailman/listinfo/python-list


"http://phr.cx" at NOSPAM

Aug 29, 2008, 6:43 PM

Post #5 of 5 (45 views)
Permalink
Re: posix semaphore support? [In reply to]

Neal Becker <ndbecker2[at]gmail.com> writes:
> Does that provide semaphores between unrelated processes?

The threading module is just for threads of a single process.
There's an shm module that implements semaphores:

http://nikitathespider.com/python/shm/
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.