This is the version history for the posix_ipc module.
As of version 1.0.0, I consider this module complete. I will continue to suppport it and look for useful features to add, but right now I don't see any.
MessageQueueobjects to support Python's
selectorsstandard library module.
selectors. Mange tak to Henrik Enggaard for the
fileno()suggestion and for contributing the demo.
Semaphoreclasses didn't behave correctly when assigned a file descriptor of 0. Thanks to Thomas Troeger for the bug report.
sizeparam was ignored when opening an existing
SharedMemorysegment. Thanks to Thomas Troeger, again.
POSIX_IPC_DEBUGflag was on. Děkuji to Tomáš Zahradnický for the bug report.
A mea culpa release to clean up some accumulated technical debt.
This version was also skipped due to a release error. Those responsible for sacking the people who have just been sacked, have been sacked.
This version was skipped due to a release error. Those responsible have been sacked.
As with 0.9.7, there are no code or feature changes in this version. This version merely corrects a documentation error.
This version comes with a big wish for peace in Ukraine. Мир!
There are no code or feature changes in this version. The bump in version number reflects that this is the first version also available on PyPI.
This version comes with a big wish for peace in Ukraine. Мир!
Fixed two BSD-specific bugs introduced in version 0.9.5
that occurred if the kernel module
loaded at install time. Specifically --
posix_ipcwould build with an inappropriate value for
QUEUE_MESSAGES_MAX_DEFAULT. Subsequent attempts to create a message queue would fail unless the caller set the
max_messagesparam to an appropriate value. (This didn't affect OS X since OS X doesn't support message queues at all.)
Also, rewrote the message queue thread notification code to address
the old bug (
Fatal Python error: PyEval_AcquireLock: current thread state is NULL)
that appeared during release testing for 0.9.5 and which
has plagued me on and off since I wrote this code. The new code uses
algorithm recommended in the Python documentation which may have
been flaky when I started using it in Python 2.4. It seems stable now
under Python 2.6+/3.
sysctlfor the correct values. Köszönöm to Attila Nagy for the bug report.
Fixed a buglet. When creating shared memory under Linux and
specifying both a size and the read-only flag, creating the memory
would succeed but calling
ftruncate() would fail.
The failure to change the size was correctly reported
posix_ipc failed to clean up the shared memory segment
it had created. That's now fixed. Thanks to Kevin Miles for the bug
Added a bugfix/feature to raise an error (rather than segault) when trying to use a closed semaphore. Thanks to Russel for the suggestion and patch.
MessageQueue.receive()were only accurate to about one second due to use of the C call
time(). Switching to
gettimeofday()fixes the problem. Thanks to Douglas Young for the bug report and patch.
prober.pythat caused install to fail under Ubuntu 11.10.
prober.pyspecified link options in the wrong order, and so linking one of the test applications that's built during setup was failing. Thanks to Kevin Miles for the bug report.
prober.pyto see if
sysconf_namesexists in the
osmodule. It doesn't exist under Cygwin, and this code caused an error on that platform. Thanks to Rizwan Raza for the bug report.
ceval: tstate mix-upand other fun messages. Thanks to Lev Maximov for the bug report.
demo3directory with demos of message queue. This was supposed be included in version 0.9.0 but I accidentally left it out. (Also reported by Lev.)
demo3 directory with demos of message queue
notification techniques. Also, fixed two bugs related to message
queue notification. Big thanks to
Philip D. Bober for debugging and providing a patch to the
most difficult part of the code. The bugs were –
process_notification()were simply wrong. They worked some (most?) of the time but would segfault eventually because I was creating a Python thread state when I should not have.
process_notification()failed to consider that the user's callback might re-request notification, thus overwriting pointers that I would later decref.
process_notification()is now thread-safe.
Fixed a sloppy declaration that caused a compile error under Cygwin 1.7.1. Thanks to Jill McCutcheon for the bug report.
Fixing these bugs was made easier by this realization:
on all of the systems to which I have access that implement
message queues (FreeBSD, OpenSolaris, Linux, and Windows +
Cygwin), all except Linux implement them as
memory-mapped files or something similar. On these
non-Linux systems, the
maximum queue message count and size are pretty darn big
LONG_MAX). Therefore, only on Linux is anyone likely to
encounter limits to message queue size and content.
The first bug I fixed was related to four message queue
constants mentioned in
QUEUE_MESSAGE_SIZE_MAX_DEFAULT. All four were defined
code, but the two
XXX_DEFAULT constants weren't exposed on
the Python side.
The second bug was that under Linux,
QUEUE_MESSAGE_SIZE_MAX were permanently fixed to their
posix_ipc's compile/install time even if the
relevant system values changed later. Thanks to Kyle Tippetts
for bringing this to my attention.
QUEUE_MESSAGES_MAX_DEFAULT was arbitrarily limited to
(at most) 1024. This wasn't a bug, just a bad choice.
I made a few changes in order to fix these problems –
QUEUE_MESSAGE_SIZE_MAXhave been deleted since they were only sure to be accurate on systems where they were irrelevant. Furthermore, Linux (the only place where they matter) exposes these values through the file system (in
/proc/sys/fs/mqueue/msgsize_maxrespectively) so Python apps that need them can read them without any help from
QUEUE_MESSAGE_SIZE_MAX_DEFAULTare now exposed to Python as they should have been all along.
QUEUE_MESSAGES_MAX_DEFAULTis now set to
LONG_MAXon all platforms except Linux, where it's set at compile time from
QUEUE_MESSAGE_SIZE_MAX_DEFAULTremains at the fairly arbitrary value of 8k. It's not a good idea to make it too big since a buffer of this size is allocated every time
MessageQueue.receive()is called. Under Linux, I check the contents of
QUEUE_MESSAGE_SIZE_MAX_DEFAULTsmaller if necessary.
Added Python 3.1 support.
ValueError, but with a message that may or may not have correctly identified the cause. (My code was making an educated guess that was sometimes wrong.)
As of this version, if initialization of an IPC object
fails with the error code
posix_ipc raises a
with the vague-but-correct message "Invalid parameter(s)".
Fixed a bug where a
attribute returned garbage. Grazie to Stefano Debenedetti for
the bug report.
There were no functional changes to the module in this version, but
I added the convenience function
close_fd() and fixed
some docmentation and demo bugs/sloppiness.
SharedMemory.close_fd(). Thanks to Kyle Tippetts for pointing out the usefulness of this.
posix_ipc_module.cwhich was still referring to GPL.
LONG_MAXunder cygwin. (Danke to René Liebscher.)
#define PAGE_SIZEin probe_results.h with
#ifndef/#endifbecause it is already defined on some systems. (Danke to René Liebscher, again.)
Thanks to Maciek W. for reporting the problem and to Piet van Oostrum and Greg for help with a solution.
current_messagesattribute didn't match the name given in the documentation.
modeattribute to each type.
repr()support to each object.
SEM_VALUE_MAXon Linux (Ubuntu) that I introduced in the previous version.
PAGE_SIZEattribute. This was already available in the mmap module that you need to use shared memory anyway, but adding it makes the interface more consistent with the
try_acquire()method. The same functionality is now available by passing a timeout of