473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Re: GIL cpu multi core usage problem

En Mon, 09 Jun 2008 15:26:09 -0300, Pau Freixes <pf******@gmail.com>
escribió:
Surly this is a recurring theme into python dev world, but I need your
help
for confirm if the follow image it's really

http://www.milnou.net/~pfreixes/img/cpu_usage_gil_problem.png<http://www.milnou.net/%7Epfreixes/img/cpu_usage_gil_problem.png>

I'm writing a brief article for my blog and I need to make sure about the
current problem with GIL and multi core environments, this picture try to
explain with images the problem for scheduling multiple threads running
python code of same interpreter into multiple cpu cores. Can anyone
confirm
to me this picture ?
Yes, if both threads are executing pure Python code, they can't run
simultaneously.

Note that:
- C extensions (usually) release the GIL when they don't call into any
Python code
- The interpreter also releases the GIL before any I/O operation
If the process is I/O bound then the GIL is not so important, and if it's
CPU bound you may benefit from reimplementing the critical parts in C (by
example, using NumPy for a number-crunching process). Another alternative
is to use multiple processes with some form of IPC instead of multiple
threads.
These are the usual arguments against "fear of GIL". You should consider
your specific application to see if the GIL is actually a problem in your
case or not.

--
Gabriel Genellina

Jun 27 '08 #1
0 1068

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours,...
4
by: Martinfnp | last post by:
Hello all, I'm completely new in theory of C compiler and it's support for multi-core hardware. Does anybody know whether compiler for multi-core and SMP/AMP/BMP does need some special internal...
3
by: Doug | last post by:
I'm having problems w/ the VS2005 debugger with C#. It blows past any breakpoints in even the simplest "Hello World" console application. I can't do any step-by-step debugging. I've provided the...
5
by: shumaker | last post by:
I just read an overview of C# 3.0, and it occured to me that some of these features could make it much easier to write programs that automatically make use of multi core processors. After reading...
5
by: Coaster | last post by:
I am designing a process which will spawn a good number of threads and some of them will execute a c++ process which is quite memory intensive (although not multithreaded). This will run on a 2 cpu...
0
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing...
3
by: 06michwats | last post by:
hello i have a windows vista pc with a dual core pentium 1.8ghz processor and 2 GB of ram some times randomly when i'm working the cpu usage will change to 50% all on one core (so one core is at...
3
by: Fred | last post by:
We all agree that multi-core is where the industry is headed. Can the .NET framework take advantage of multi-cores? are the programs written in .NET multi-threaded by default or is additional...
1
by: =?Utf-8?B?U29sb1NFTw==?= | last post by:
Windows Vistaâ„¢ Ultimate 32BIT Version 6.0.6001 Service Pack 1 Build 6001 System Manufacturer HP Pavilion 061 System Model EG194AA-ABA A1250N System Type X86-based PC Processor AMD Athlon 64 X2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.