Re: Threads, GIL and re.match() performance

2008-06-27 Thread Sebastian "lunar" Wiesner
Jeff <[EMAIL PROTECTED]>: > (and possibly intermediate results) These could be stored purely in C space, without refcounting needed. -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads, GIL and re.match() performance

2008-06-26 Thread Jeff
> However, I assumed that calls to (thread safe) C Library functions > release the global interpreter lock. This is mainly applicable to external C libraries. The interface to them may not be thread-safe; anything that uses the Python API to create/manage Python objects will require use of the GI

Re: Threads, GIL and re.match() performance

2008-06-26 Thread Pau Freixes
Hi Ok, if I understand between Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS is not possible use a C/Python api functions ? Sorry, but when thread enter another time with Py_END_ALLOW_THREADS this thread enter to competition to lock GIL ? Thks Thks On Thu, Jun 26, 2008 at 12:16 PM, Matthieu

Re: Threads, GIL and re.match() performance

2008-06-26 Thread Matthieu Brucher
Hi, The C-API uses references counts as well, so it is not threadsafe. Matthieu 2008/6/26 Pau Freixes <[EMAIL PROTECTED]>: > But Python C-API[1] it's the main base for extent python with C/c++, and > this is not not threadsafe.? I dont understand > > [1] http://docs.python.org/api/api.html > > O

Re: Threads, GIL and re.match() performance

2008-06-26 Thread Pau Freixes
But Python C-API[1] it's the main base for extent python with C/c++, and this is not not threadsafe.? I dont understand [1] http://docs.python.org/api/api.html On Thu, Jun 26, 2008 at 4:49 AM, Benjamin <[EMAIL PROTECTED]> wrote: > On Jun 25, 9:05 am, Mirko Dziadzka <[EMAIL PROTECTED]> wrote: > >

Re: Threads, GIL and re.match() performance

2008-06-25 Thread Benjamin
On Jun 25, 9:05 am, Mirko Dziadzka <[EMAIL PROTECTED]> wrote: > > 1) Is there a reason for this? I think it is because the Python re library uses the Python C-API which is not threadsafe. > 2) Is the regex library not thread-safe? > 3) Is it possible, to release the GIL in re.match() to >    get m

Re: Threads, GIL and re.match() performance

2008-06-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Mirko Dziadzka <[EMAIL PROTECTED]> wrote: > >I understand that the C implementation of Python use a global interpreter >lock to avoid problems, so doing CPU bound tasks in multiple threads >will not result in better performance on multi-CPU systems. > >However, I as

Threads, GIL and re.match() performance

2008-06-25 Thread Mirko Dziadzka
Hi all I understand that the C implementation of Python use a global interpreter lock to avoid problems, so doing CPU bound tasks in multiple threads will not result in better performance on multi-CPU systems. However, I assumed that calls to (thread safe) C Library functions release the global i