Pycsp

Latest version: v0.9.2

Safety actively analyzes 621673 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.9.1

----------
* Added Python 3 support
* Fixed issue with leaking mobile channelends during shutdown
- See examples/problems/parallel_leaking_mobile_channelend_garbage_collection_pre_0.9.2.py
* Reorganised the distribution of PyCSP to always include both pycsp.parallel and
pycsp.greenlets
* Removed ssh_python and cluster_python parameters from sshprocess and clusterprocess.
The remote python interpreter will use the full path of sys.executable to find the
correct installation.
* Fixed bug, where an internal call to select.select would throw an unwanted exception

0.9.0

----------
* Parallel and Sequence now returns a list of return values from all the processes.
>>> Parallel(P1(), P2())
['Hello', 'World']
* Added remote process implementations
sshprocess(ssh_host, ssh_port=22, ssh_user, ssh_password, ssh_python='python')
clusterprocess(cluster_nodefile="$PBS_NODEFILE", cluster_pin, cluster_hint='blocked', cluster_ssh_port=22, cluster_python='python'):

0.7.1

----------
* threads, processes and net has been completely rewritten into a new single
implementation named pycsp.parallel. Thus available implementations are now
- pycsp.parallel (default)
- pycsp.greenlets
* pycsp.greenlets has not been changed. Simple and fast.
* The trunk repository has been split into two versions. The base which
only requires standard CPython libraries and the extras version, which
adds all the extra stuff (greenlets, and so on) that requires external
libraries.
* Previously buffered channels were implemented as a string of processes. This
would greatly limit performance, as the latency for communicating across
a channel would increase. Now, a buffered channel has an internal buffer and
perform only slightly more work than an unbuffered channel. Also the buffer
has a location, which means that a buffered channel can be used to hide the
latency induced by the data-transfer latency.
* All channels in pycsp.parallel are created as network-enabled channels and supports
communicating with remote processes.
* Added a new process type multiprocess which runs as an OS-process. This enables
mixing process and multiprocess in one PyCSP network.
* Added a shutdown() method, which must be called at the end of all applications
importing pycsp. It closes the channel references and waits for all references to
leave hosted channels, thus ensuring that the PyCSP network is left in a robust
state.
* Found a design flaw in AltSelect, which means that AltSelect does not guarantee
priority when affected by network and scheduling latencies. A new PriSelect have
been added which is slightly slower but does guarantee priority and thus should
be used whenever the SkipGuard is needed.

0.7.0

----------
* (pycsp.greenlets) Fixed issue with communicating on channels from the main namespace.
* (pycsp.greenlets) Fixed propagation of exceptions from io functions.
* Added "fair" version of AltSelect, which uses the history from an Alternation to perform an ordered AltSelect (priority)
* Replaced use of environment variables for some module magic.
* Added pycsp.common.trace module
* Moved AltSelect and FairSelect to a separate file (altselect.py)
* Added Channel() * 3 and 2 * Channel() functionality
* removed const.py from individual implementations.
* Added support for Jython and IronPython in the threads implementation.

0.6.2

----------
* Added a raised Exception('Deadlock') when all processes are blocked on
channel communication. Only pycsp.greenlets has this deadlock detection.
* Added a wrapper for Alternation to simplify usage. It consists of
the following constructs AltSelect, InputGuard, OutputGuard,
SkipGuard and TimeoutGuard:

AltSelect examples:
AltSelect(
InputGuard(register, action=add_service()),
InputGuard(inc, action=dispatch())
)

AltSelect(
OutputGuard(left, msg=True, action="right(True)"),
OutputGuard(right, msg=True, action="left(True)")
)

ch, msg = AltSelect(
InputGuard(workerIn),
OutputGuard(workerOut, jobs[-1]),
SkipGuard()
)

* Added buffered channels to all versions.
Usage: A = Channel(buffer=<N>) where <N> is the wanted buffer size.
The Channel is implemented in buffer.py as a process maintaining a list of
buffered elements.
* Fixed (threads) bug in Alternation, where a poison or retire could overwrite a committed match.
* Fixed a poor design choice. The naming __channel_input can have unwanted side-effects
in Python, thus __channel_input is renamed to channel_input. Sorry for the inconvenience.
* Removed the Channel.status method.
* Fixed bug in propagation of poison / retire.
* Fixed Python 2.4 support for threads implementation.
* Added pycsp.common package that contains plugNplay processes and other general process
templates.
Usage:

from pycsp.threads import *
from pycsp.common import plugNplay

Parallel(plugNplay.Prefix(cin, cout, prefix=1))

* Added current_process_id() function for debugging purposes. It returns the unique id of the
pycsp process executing current_process_id().
* Changed matching of channels in function parameter lists, when propagating retire and poison.
* Changed Alternation.execute to also return (guard, msg) just as Alternation.select.

0.6.1

----------
* Changed the reserved variable name for reading channel inputs from ChannelInput
to __channel_input.
* choice will now create a function that instantiates a Choice object. This can be used to
send other arguments to the wrapped choice function.
Example:
choice
def action(id, __channel_input):
print id, __channel_input

Alternation([{cin:action(42)}]).execute()

* Changed the internal representation of guards in Alternation and added an optional syntax
for usage in the guardlist. These are now equivalent and legal arguments for Alternation.
- input guard: [{cin1:action()}] <-> [(cin1, action())]
- output guard: [{(cout1, msg):action()}] <-> [(cout1, msg, action()]

* Fixed a bug in reference counting for retire, that could result in a race condition.
* Fixed (greenlets) bug where retire could overwrite a committed request.
* Fixed propagation of poison and retire, when channelends are in lists / dictionaries.
* Added syntactic sugar to allow multiplying processes.
Example:
Parallel(
producer(OUT(jobs),10000, 1000),
10 * worker(IN(jobs),OUT(results)),
consumer(IN(results)))

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.