[Patches] SysV IPC Implementation

John Fremlin chief@bandits.org
14 May 2001 16:51:23 +0100


I have a written a SysV IPC message queue C module, and a python
SysVQueue class (modelled on Queue.Queue) to provide a cleaner
interface to the SysV functionality. 

SysV message queues are used for interprocess communication, and thus
avoid the hassle of posix threads. Why is an interface not included in
the standard Python distribution? Would such a package be accepted for
inclusion?

It would be much simpler for me if I could submit a patch to the
standard distribution, as I don't want to have to deal with building
and installing a Python C module in my project.

For the record, the following functions are made AFAIK fully
accessible from Python by the C module:

        ftok
        msgget
        msgsnd
        msgrcv

The msgctl syscall is broken up into three logical functions:

        msgctl_rm
        msgctl_stat
        msgctl_set

And the public fields of the msgqid_ds stucture are made accessible.

The SysVQueue class provides the functionality of the Queue class,
except that it is impossible to set a maximum size, objects added to
it have to be pickleable, and the "full" method is missing.

Only tested on Linux 2.4.
-- 
BTW, I'm looking for a summer job in Europe.

	http://ape.n3.net