March 17, 2008

Twenty Years

    There are twenty years to go
    And twenty ways to know
    Who'll wear, who'll wear the hat
  
    There are twenty years to go
    The best of all I hope
    Enjoy the ride
    The medicine show
  
    Thems the breaks
    For we designer fakes
    We need to concentrate on more than meets the eye
  
    There are twenty years to go
    The faithful and the low
    The best of starts, the broken heart, the stone
  
    There are twenty years to go
    The punch drunk and the blow
    The worst of starts, the mercy part, the phone
  
    And thems the breaks
    For we designer fakes
    We need to concentrate on more than meets the eye
  
    Thems the breaks
    For we designer fakes
    But it's you i take, cause you're the truth, not I
  
    There are twenty years to go
    A golden age I know
    But all will pass will end too fast you know
  
    There are twenty years to go
    And many friends I hope
    Though some may hold the rose
    Some hold the rope
  
    That's the end - and that's the start of it
    That's the whole - and that's the part of it
    That's the hide - and that's the heart of it
    That's the long - and that's the short of it
    That's the best - and that's the test in it
    That's the doubt - the doubt, the trust in it
    That's the sight - and that's the sound of it
    That's the gift - and that's the trick in it
  
    You're the truth, not I, you're the truth, not I
    You're the truth, not I, you're the truth, not I
  
    You're the truth, not I, you're the truth, not I
    You're the truth, not I, You're the truth, not I.
Placebo

Posted by Hoang at 09:06 PM | Add the first comment | Music

March 07, 2008

Python on Multi-Core

I just attended a session at SD2008 on parallelism put on by an Intel engineer this week.The topic was on increasing executable performance by utilizing threading and Intel's Threading Building Blocks (TBB) library. TBB offers some Template style constructs to easily utilize the CPU's multiple cores. Unfortunately, Intel's focus is on C++ and Fortran (statically typed languages). Pondering over execution speed, I was just thinking that Python programs could sure use a bump. Does anyone know whether Python 2.5 or IronPython makes use of the parallel nature of the newer multi-core processors when threading is used? What about utilizing the multi-core even on single threaded programs?

After jotting this down, I did a search to see if anyone else has posed the same question. These are what I found:

I had done some embedding of the Python interpreter into a C++ executable before and had to learn about the GIL. Apparently Python simulates multithreading by allowing each of its threads to obtain the Global Interpreter Lock. Each thread grabs the lock and runs its allotted time while blocking all other threads. From the OS point-of-view, this is still a single thread being time-shared. Adding CPUs won't help performance because only 1 will be utilized while all others are idle.

Anyone have further thoughts or links to share on this topic?

March 01, 2008