Marc-Andre Lemburg <m...@egenix.com> added the comment:

A few things:

 * The ceval_gil.h file is missing from the patch.

 * Please check whether you can move these variable declarations inside the 
main loop function (as statics):

+/* This single variable consolidates all requests to break out of the fast path
+   in the eval loop. */
+static volatile int eval_breaker = 0;
+/* Request for droppping the GIL */
+static volatile int gil_drop_request = 0;
+/* Request for running pending calls */
+static volatile int pendingcalls_to_do = 0; 
+/* Request for looking at the `async_exc` field of the current thread state */
+static volatile int pending_async_exc = 0;

 * Instead of deprecating the set/getcheckinterval APIs, convert the arguments 
passed to these to the switch interval. The new APIs set/getswitchinteral are 
then not needed.

 * Please add the fallback solutions from the time module in case 
gettimeofday() is not available. You cannot assume that "all modern POSIX 
systems" implement that API - it was introduced in POSIX 2001 and Python 2.x 
still supports OSes that were released prior to that year.

 * Note that gettimeofday() et al. are rather slow APIs on most systems. It 
would be better to directly use a simple performance timer since we don't 
really need any timing accuracy in managing the GIL when run with threads. Have 
a look at the clock_gettime() API for ways of accessing such timers. There may 
also be other ways of accessing such times via pthreads.

 * I haven't looked at the timing details of the implementation, but please 
make sure that it works even if the clock interval is a few ms (while 
gettimeofday() provides us resolution, the system clock may still only tick in 
ms intervals - another reason to use CPU performance timers instead).

Thanks.

----------
nosy: +lemburg

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7753>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to