- Previous thread: Extracting text using Beautifulsoup
- Next thread: virtualenv under Win7: easy_install fails in virtual environments
- Threads sorted by date: python 200910
> The new GIL does away with this by ditching _Py_Ticker entirely and
> instead using a fixed interval (by default 5 milliseconds, but settable)
> after which we ask the main thread to release the GIL and let another
> thread be scheduled.
I've looked at this part of the implementation, and have a few comments.
a) why is gil_interval a double? Make it an int, counting in
microseconds.
b) notice that, on Windows, minimum wait resolution may be as large as
15ms (e.g. on XP, depending on the hardware). Not sure what this
means for WaitForMultipleObjects; most likely, if you ask for a 5ms
wait, it waits until the next clock tick. It would be bad if, on
some systems, a wait of 5ms would mean that it immediately returns.
c) is the gil_drop_request handling thread-safe? If your answer is
"yes", you should add a comment as to what the assumptions are of
this code (ISTM that multiple threads may simultaneously attempt
to set the drop request, overlapping with the holding thread actually
dropping the GIL). There is also the question whether it is
thread-safe to write into a "volatile int"; I keep forgetting the
answer.
Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/bull%40pubbs.net
> instead using a fixed interval (by default 5 milliseconds, but settable)
> after which we ask the main thread to release the GIL and let another
> thread be scheduled.
I've looked at this part of the implementation, and have a few comments.
a) why is gil_interval a double? Make it an int, counting in
microseconds.
b) notice that, on Windows, minimum wait resolution may be as large as
15ms (e.g. on XP, depending on the hardware). Not sure what this
means for WaitForMultipleObjects; most likely, if you ask for a 5ms
wait, it waits until the next clock tick. It would be bad if, on
some systems, a wait of 5ms would mean that it immediately returns.
c) is the gil_drop_request handling thread-safe? If your answer is
"yes", you should add a comment as to what the assumptions are of
this code (ISTM that multiple threads may simultaneously attempt
to set the drop request, overlapping with the holding thread actually
dropping the GIL). There is also the question whether it is
thread-safe to write into a "volatile int"; I keep forgetting the
answer.
Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/bull%40pubbs.net
Conversations: [Python-Dev] Reworking the GIL
- [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-10-25T19:20:12+00:00
- Re: [Python-Dev] Reworking the GIL by Brett Cannon on 2009-10-25T22:00:06+00:00
- Re: [Python-Dev] Reworking the GIL by Terry Reedy on 2009-10-26T05:09:05+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-10-26T10:19:36+00:00
- Re: [Python-Dev] Reworking the GIL by Andrew MacIntyre on 2009-10-26T12:47:49+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-10-26T13:45:13+00:00
- Re: [Python-Dev] Reworking the GIL by Kristján Valur Jónsson on 2009-10-26T14:09:55+00:00
- Re: [Python-Dev] Reworking the GIL by ssteinerX@gmail.com on 2009-10-26T14:26:52+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-10-26T15:47:27+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-10-26T15:59:19+00:00
- Re: [Python-Dev] Reworking the GIL by Daniel Stutzbach on 2009-10-26T16:19:09+00:00
- Re: [Python-Dev] Reworking the GIL by Collin Winter on 2009-10-26T20:09:39+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-10-26T21:45:25+00:00
- Re: [Python-Dev] Reworking the GIL by Collin Winter on 2009-10-26T21:50:23+00:00
- Re: [Python-Dev] Reworking the GIL by on 2009-10-26T22:46:58+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-01T10:34:59+00:00
- Re: [Python-Dev] Reworking the GIL by Brett Cannon on 2009-11-01T20:20:05+00:00
- Re: [Python-Dev] Reworking the GIL by Christian Heimes on 2009-11-01T21:15:22+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-01T21:29:11+00:00
- Re: [Python-Dev] Reworking the GIL by Christian Heimes on 2009-11-01T21:44:07+00:00
- Re: [Python-Dev] Reworking the GIL by Gregory P. Smith on 2009-11-02T05:39:47+00:00
- Re: [Python-Dev] Reworking the GIL by "Martin v. Löwis" on 2009-11-02T08:08:59+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-11-02T09:28:53+00:00
- Re: [Python-Dev] Reworking the GIL by "Martin v. Löwis" on 2009-11-02T09:44:59+00:00
- Re: [Python-Dev] Reworking the GIL by "Martin v. Löwis" on 2009-11-02T10:45:36+00:00
- Re: [Python-Dev] Reworking the GIL by "Martin v. Löwis" on 2009-11-02T11:53:03+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-11-02T13:07:59+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-02T13:20:43+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-11-02T13:23:59+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-11-02T13:42:00+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-02T13:54:04+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-11-02T14:09:04+00:00
- Re: [Python-Dev] Reworking the GIL by John Arbash Meinel on 2009-11-02T14:27:43+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-02T14:34:31+00:00
- Re: [Python-Dev] Reworking the GIL by "Martin v. Löwis" on 2009-11-02T16:27:47+00:00
- Re: [Python-Dev] Reworking the GIL by Daniel Stutzbach on 2009-11-02T16:44:32+00:00
- Re: [Python-Dev] Reworking the GIL by Sturla Molden on 2009-11-02T17:14:02+00:00
- Re: [Python-Dev] Reworking the GIL by Baptiste Lepilleur on 2009-11-07T09:52:26+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-07T14:09:16+00:00
- Re: [Python-Dev] Reworking the GIL by Guido van Rossum on 2009-11-07T15:08:20+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-07T16:02:57+00:00
- Re: [Python-Dev] Reworking the GIL by Guido van Rossum on 2009-11-07T18:33:39+00:00
- Re: [Python-Dev] Reworking the GIL by Baptiste Lepilleur on 2009-11-07T18:39:10+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-07T18:55:59+00:00
- Re: [Python-Dev] Reworking the GIL by Baptiste Lepilleur on 2009-11-08T13:09:02+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-08T13:20:32+00:00
- Re: [Python-Dev] Reworking the GIL by Antoine Pitrou on 2009-11-10T20:35:55+00:00
- Re: [Python-Dev] Reworking the GIL by Stefan Ring on 2009-11-23T10:29:49+00:00
Related Threads
- apt-pinning... and force old version. - debian
- pkg-discuss - Code Review for 16122 Speed up getting license info - opensolaris
- r31189 -S06 - print default usage messag to standard output, by petition from avar++ - perl
- db50 (DB11gR2) - Unsupported Berkeley DB version - postfix
- RE:resize freebsd slice - freebsd
- Ada - Optimize 2**N in more contexts - gcc
- How to print via python on windows - python
- ABOUT PEOPLE WITH WHOM MATRIMONY IS PROHIBITED - openbsd
- muralis module - perl
- camel netty & batch - apachecamel
- svn commit: r956651 20/37 - - in /ofbiz/branches/jquery: ./ framework/common/widget/ framework/images/webapp/images/jquery/plug - ofbiz
- osol-discuss - setting proper screen resolution - opensolaris