========================================
 Changelog for the `processing` package
========================================


Changes in 0.36
---------------

* In recent versions on Unix the finalizers in a manager process were
  never given a chance to run before `os._exit()` was called, so old
  unlinked AF_UNIX sockets could accumulate in '/tmp'.  Fixed.

* The shutting down of managers has been cleaned up.

* In previous versions on Windows trying to acquire a lock owned by a
  different thread of the current process would raise an exception.
  Fixed.

* In previous versions on Windows trying to use an event object for
  synchronization between two threads of the same process was likely
  to raise an exception.  (This was caused by the bug described
  above.)  Fixed.

* Previously the arguments to `processing.Semaphore()` and
  `processing.BoundedSemaphore()` did not have any defaults.  The
  defaults should be 1 to match `threading`.  Fixed.

* It should now be possible for a Windows Service created by using
  `pywin32` to spawn processes using the `processing` package.

  Note that `pywin32` apparently has a bug meaning that `Py_Finalize()` 
  is never called when the service exits so functions registered with
  `atexit` never get a chance to run.  Therefore it is advisable to
  explicitly call `sys.exitfunc()` or `atexit._run_exitfuncs()` at the
  end of `ServiceFramework.DoSvcRun()`.  Otherwise child processes are
  liable to survive the service when it is stopped.  Thanks to Charlie
  Hull for the report.

* Added `getLogger()` and `enableLogging()` to support logging.


Changes in 0.35
---------------

* By default processes are no longer be stoppable using the `stop()`
  method: one must call `setStoppable(True)` before `start()` in order
  to use the `stop()` method.  (Note that `terminate()` will work
  regardless of whether the process is marked as being "stoppable".)

  The reason for this is that on Windows getting `stop()` to work
  involves starting a new console for the child process and installing
  a signal handler for the `SIGBREAK` signal.  This unfortunately
  means that Ctrl-Break cannot not be used to kill all processes of
  the program.

* Added `setStoppable()` and `getStoppable()` methods -- see above.

* Added `BufferedQueue`/`BufferedPipeQueue`/`BufferedPosixQueue`.
  Putting an object on a buffered queue will always succeed without
  blocking (just like with `Queue.Queue` if no maximum size is
  specified).  This makes them potentially safer than the normal queue
  types provided by `processing` which have finite capacity and may
  cause deadlocks if they fill.

  `test/test_worker.py` has been updated to use `BufferedQueue` for
  the task queue instead of explicitly spawning a thread to feed tasks
  to the queue without risking a deadlock.

* Now when the NO_SEM_TIMED macro is set polling will be used to get
  around the lack of `sem_timedwait()`.  This means that
  `Condition.wait()` and `Queue.get()` should now work with timeouts
  on Mac OS X.

* Added a `callback` argument to `Pool.apply_async()`.

* Added `test/test_httpserverpool.py` which runs a pool of http
  servers which share a single listening socket.

* Previously on Windows the process object was passed to the child
  process on the commandline (after pickling and hex encoding it).
  This caused errors when the pickled string was too large.  Now if
  the pickled string is large then it will be passed to the child
  over a pipe or socket.

* Fixed bug in the iterator returned by `Pool.imap()`.

* Fixed bug in `Condition.__repr__()`.

* Fixed a handle/file descriptor leak when sockets or connections are
  unpickled.


Changes in 0.34
---------------

* Although version 0.33 the C extension would compile on Mac OSX
  trying to import it failed with "undefined symbol: _sem_timedwait".
  Unfortunately the `ImportError `exception was silently swallowed.
  
  This is now fixed by using the `NO_SEM_TIMED` macro.  Unfortunately
  this means that some methods like `Condition.wait()` and
  `Queue.get()` will not work with timeouts on Mac OS X.  If you
  really need to be able to use timeouts then you can always use the
  equivalent objects created with a manager.  Thanks to Doug Hellmann
  for report and testing.
  
* Added a `terminate()` method to process objects which is more
  forceful than `stop()`.

* Fixed bug in the cleanup function registered with `atexit` which on
  Windows could cause a process which is shutting down to deadlock
  waiting for a manager to exit.  Thanks to Dominique Wahli for report
  and testing.
  
* Added `test/test_workers.py` which gives an example of how to create
  a collection of worker processes which execute tasks from one queue
  and return results on another.

* Added `processing.Pool()` which returns a process pool object.  This
  allows one to execute functions asynchronously.  It also has a
  parallel implementation of the `map()` builtin.  This is still
  *experimental* and undocumented --- see `test/test_pool.py` for
  example usage.


Changes in 0.33
---------------

* Added a `recvbytes_into()` method for receiving byte data into
  objects with the writable buffer interface.  Also renamed the
  `_recv_string()` and `_send_string()` methods of connection objects
  to `recvbytes()` and `sendbytes()`.

* Some optimizations for the transferring of large blocks of data
  using connection objects.

* On Unix `os.sysconf()` is now used by default to determine whether
  to compile in support for posix semaphores or posix message queues.
  
  By using the `NO_SEM_TIMED` and `NO_MQ_TIMED` macros (see
  `INSTALL.txt`) it should now also be possible to compile in
  (partial) semaphore or queue support on Unix systems which lack the
  timeout functions `sem_timedwait()` or `mq_timedreceive()` and
  `mq_timesend()`.

* `gettimeofday()` is now used instead of `clock_gettime()` making
  compilation of the C extension (hopefully) possible on Mac OSX.  No
  modificaton of `setup.py` should be necessary.  Thanks to Michele
  Bertoldi for report and proposed patch.

* `cpuCount()` function added which returns the number of CPUs
  in the system.

* Bugfixes to `PosixQueue` class.


Changes in 0.32
---------------

* Refactored and simplified `_nonforking` module -- info about
  `sys.modules` of parent process is no longer passed on to child
  process.  Also `pkgutil` is no longer used.

* Allocated space from an mmap used by `LocalManager` will now be
  recycled.

* Better tests for `LocalManager`.

* Fixed bug in `managers.py` concerning refcounting of shared objects.
  Bug affects the case where the callable used to create a shared
  object does not return a unique object each time it is called.
  Thanks to Alexey Akimov for the report.

* Added a `freezeSupport()` function. Calling this at the appropriate
  point in the main module is necessary when freezing a multiprocess
  program to produce a Windows executable.  (Has been tested with
  `py2exe`, `PyInstaller` and `cx_Freeze`.)


Changes in 0.31
---------------

* Fixed one line bug in `localmanager.py` which caused shared memory maps
  not to be resized properly.

* Added tests for shared values/structs/arrays to `test/test_processing`.


Changes in 0.30
----------------

* Process objects now support the complete API of thread objects.

  In particular `isAlive()`, `isDaemon()`, `setDaemon()` have been
  added and `join()` now supports the `timeout` paramater.

  There are also new methods `stop()`, `getPid()` and `getExitCode()`.
  
* Implemented synchronization primitives based on the Windows mutexes
  and semaphores and posix named semaphores.  

* Added support for sharing simple objects between processes by using
  a shared memory map and the `struct` or `array` modules.

* An `activeChildren()` function has been added to `processing` which
  returns a list of the child processes which are still alive.

* A `Pipe()` function has been added which returns a pair of
  connection objects representing the ends of a duplex connection over
  which picklable objects can be sent.

* socket objects etc are now picklable and can be transferred between
  processes.  (Requires compilation of the `_processing` extension.)

* Subclasses of `managers.BaseManager` no longer automatically spawn a
  child process when an instance is created: the `start()` method must be
  called explicitly.

* On Windows child processes are now spawned using `subprocess`.

* On Windows the Python 2.5 version of `pkgutil` is now used for
  loading modules by the `_nonforking` module.  On Python 2.4 this
  version of `pkgutil` (which uses the standard Python licence) is
  included in `processing.compat`.

* The arguments to the functions in `processing.connection` have
  changed slightly.

* Connection objects now have a `poll()` method which tests whether
  there is any data available for reading.

* The `test/py2exedemo` folder shows how to get `py2exe` to create a
  Windows executable from a program using the `processing` package.

* More tests.

* Bugfixes.

* Rearrangement of various stuff.


Changes in 0.21
---------------

* By default a proxy is now only able to access those methods of its
  referent which have been explicitly exposed.

* The `connection` sub-package now supports digest authentication.

* Process objects are now given randomly generated 'inheritable'
  authentication keys.

* A manager process will now only accept connections from processes
  using the same authentication key.

* Previously `get_module()` from `_nonforking.py` was seriously messed
  up (though it generally worked).  It is a lot saner now.

* Python 2.4 or higher is now required.


Changes in 0.20
---------------

* The `doc` folder contains HTML documentation.

* `test` is now a subpackage.  Running `processing.test.main()` 
  will run test scripts using both processes and threads.

* `nonforking.py` has been renamed `_nonforking.py`.
  `manager.py` has been renamed `manager.py`.
  `connection.py` has become a sub-package `connection`

* `Listener` and `Client` have been removed from
  `processing`, but still exist in `processing.connection`.

* The package is now *probably* compatible with versions of Python
  earlier than 2.4.

* `set` is no longer a type supported by the default manager type.

* Many more changes.


Changes in 0.12
---------------

* Fixed bug where the arguments to `processing.Manager()` were passed on
  to `processing.manager.DefaultManager()` in the wrong order.

* `processing.dummy` is now a subpackage of `processing`
  instead of a module.

* Rearranged package so that the `test` folder, `README.txt` and
  `CHANGES.txt` are copied when the package is installed.


Changes in 0.11
---------------

* Fixed bug on windows when the full path of `nonforking.py` contains a
  space.

* On unix there is no longer a need to make the arguments to the
  constructor of `Process` be picklable or for and instance of a
  subclass of `Process` to be picklable when you call the start method.

* On unix proxies which a child process inherits from its parent can
  be used by the child without any problem, so there is no longer a
  need to pass them as arguments to `Process`.  (This will never be
  possible on windows.)
