On 22 Ιαν 2008, at 1:45 ΜΜ, Graham Perrin wrote:

>
> Off-topic from MacFUSE, but I expect that this group's combined
> knowledge of Python and Mac OS will have an answer to this question:
>
> If
>
>> a multi-threaded Python program effectively only uses one CPU
>
> then why might it sometimes _appear_ (in Activity Monitor, MenuMeters
> and the like) that a single python process on a multiprocessor Mac is
> either:
>
> a) running near (occasionally just over) 100% spread across both CPUs?
>
> or
>
> b) making maxmimum use (i.e. an apparent total of ~200%) of both CPUs?
>
> ----
>
> Is this a misinterpretation by, or of, Activity Monitor?
>
> Or: is Mac OS X somehow superior to other OSes, with regard to the
> accepted knowledge about Python on multiprocessor machines?

Python modules written in C can use more than one CPU (their C part).
However, any C code that uses Python calls, or any pure python code
always runs under the Great Interpreter Lock and is limited on one CPU.

This is a constraint of the Python interpreter, Mac OS X has nothing to
do with it.


>
>
> TIA for any advice.
>
> Graham Perrin, Project/Media Development Officer
> CENTRIM - the Centre for Research in Innovation Management
> <http://www.brighton.ac.uk/centrim/people/a-z/gjp4>
> +44-1273-877922
>
> <http://www.python.org/doc/faq/library/#can-t-we-get-rid-of-the- 
> global-
> interpreter-lock>
> <http://www.nabble.com/Single-Python-process-utilising-multiple-CPUs--
> td14985023s6741.html>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"macfuse-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/macfuse-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to