On Aug 15, 2004, at 11:38 PM, Stephen J. Turnbull wrote: >>>>>> "Raymond" == Raymond Hettinger <python at rcn.com> writes: > > Raymond> Threading is a technique for decoupling tasks which are > Raymond> not sequentially dependent and creating the illusion of > Raymond> concurrency. > > All simultaneity is an illusion, but the concurrency of Python threads > is not. <wink> > > Raymond> Also, multiple processors cannot boost performance > Raymond> because Python's Global Interpreter Lock (GIL) precludes > Raymond> more than one thread from running in the interpreter at > Raymond> the same time (this was done to simplify re-entrancy > Raymond> issues). > > This confused me because "running" is ambiguous. How about something > like: > > The Python interpreter itself is not fully reentrant, so threading > is accomplished by interleaving the execution of Python code from > different threads. Thus, use of multiple processors cannot boost > performance of threaded Python code, because a single instance of > the interpreter can only execute code on one processor at a time. > > (Season to taste, fix technical inaccuracies.) I see no reason to > mention the GIL, an implementation detail, at all. I think it's worth mentioning. It's absolutely necessary to know all about the GIL when writing an extension that can take advantage of threading or embed Python correctly in a threaded application. -bob
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4