Hi Davide and welcome to the group.
>is pyCSP affected by the python GIL or not.
It depends on which pycsp implementation you decide to use.
These are the available implementations and are all bundled in the
current distribution:
pycsp.threads
pycsp.processes
pycsp.greenlets
pycsp.net (proof of concept)
You will find a description of the three implementations in
http://pycsp.googlecode.com/files/paper-02.pdf
But to answer question with an example.
Limited by the GIL
{{{
import pycsp.threads as pycsp
@pycsp.process
def foolish_work():
sum = 0
for i in range(1000000):
sum += 1
Parallel(foolish_work(), foolish_work())
}}}
Not affected by the GIL:
{{{
import pycsp.processes as pycsp
@pycsp.process
def foolish_work():
sum = 0
for i in range(1000000):
sum += 1
Parallel(foolish_work(), foolish_work())
}}}
- Rune
On May 21, 12:01 pm, "Davide 'dada' Carboni" <
dcarb...@gmail.com>
wrote: