tungwaiyip.info

home

about me

links

my software

Media

Yucatán Photos

St Lucia Photos

Photo Album

Videos

Blog

< July 2009 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

Exploring parallel programming

When I first started blogging, I have a lot of geeky posting about software development. The idea of blogging is to write on short subjects frequently. It is different from writing a long article, which is so burdensome many people end up not doing it at all. But in practice, I have not lived up to expectation of a prolific blogger. Sometimes the gap between postings can be a few months.

Anyway this is the quick posting on geeky subject that I think I should do more. Recently I am working on high performance computing and number crunching task. I have dipped into writing C extension for Python for performance. I got spectacular result from the exercise. It is the best of both world. Programming in Python supplement by C is still very agile and iterative. On the other hand C is giving the performance unachievable with pure Python.

I am started to look into the multiprocessing module introduced in Python 2.6. It is a library to run multiple python processes. With an interface similar to the threading module, it is positioning itself as an alternative approach to threading to circumvent the limitation of Python's GIL. I haven't give much thought to it initially. But looking closer, I find it is really more than just an alternative to threading. It is really a parallel programming framework. For example, the method Pool.map() is really a prototype of a mapreduce framework. I am quite excited to explore this module in the coming days.

Another module I am looking at is the ctypes module. It allows Python code to call C functions directly. Again I haven't thought much about it when it was introduced in Python 2.5. That's because I haven't have a use case of it. Now that I am writing C module, I begin to realize how revolutionary it is. C module delivery great performance. But writing one is a pain. Just the need to keep track of reference count may double the number of lines of your code. For me I am not building a reusable module for other people. It is one off function for me to do number crunching. Using ctypes may allow me easier access to C without the burden of actually writing a Python module.

2009.07.12 [, ] - comments

 

 

blog comments powered by Disqus

past articles »

 

Kontagent

Kontagent is hiring software engineers

BBC News

 

Gulf states fuel Syria isolation (07 Feb 2012)

 

New Maldives leader pledges order (07 Feb 2012)

 

Iranian president summoned by MPs (07 Feb 2012)

 

LA abuse school removes all staff (07 Feb 2012)

 

Uganda MP revives anti-gay bill (07 Feb 2012)

 

California court backs gay unions (07 Feb 2012)

 

Monaco royals in privacy defeat (07 Feb 2012)

 

Royals celebrate Dickens' legacy (07 Feb 2012)

 

Euro 'could survive Greece exit' (07 Feb 2012)

 

Obama to give back campaign funds (07 Feb 2012)

more »

 

Slashdot News for nerds, stuff that matters

 

Fracture Putty Can Heal a Broken Bone In Days (2012-02-07T21:32:00+00:00)

 

Apple Could Lose .6 Billion In iPad Lawsuit (2012-02-07T20:51:00+00:00)

 

Google Releases Chrome For Android Beta (2012-02-07T20:09:00+00:00)

 

The 20th IOCCC Winners Announced (2012-02-07T19:46:00+00:00)

 

Programming Error Doomed Russian Mars Probe (2012-02-07T19:25:00+00:00)

 

Honeywell Vs Nest: When the Establishment Sues Silicon Valley (2012-02-07T18:42:00+00:00)

 

DARPA Investing In Electric Brain Stimulation To Train Snipers Quickly (2012-02-07T18:19:00+00:00)

 

Delayed Outrage Over A Censored Site; What's a Better Way To Spread News? (2012-02-07T18:00:00+00:00)

more »

 

TechPsychic Tech Rumors and Invented News

 

TechPsychic: AT&T: more money, says it's disruptive in funding from. (08 May 2010)

 

TechPsychic: I know that Apple is close to Apple Dominates, Hires ex-Googler - Yes, Android phones. (08 May 2010)

 

TechPsychic: AT&T says: Facebook Connect. (08 May 2010)

 

TechPsychic: Google's Nexus One of Google Chrome Release Adds Support subscriptions accounted for Amazon: Apple. (08 May 2010)

 

TechPsychic: Another stat: Twitter's Design of this is giving rise of BlackBerry Foursquare Map App store end. (07 May 2010)

 

TechPsychic: Like educational sales Up around Apple iPad makes money Plan costs half an Apple. (07 May 2010)

 

TechPsychic: Instead added extensions, social Networks than double, everyone jumps in Silicon Valley? (07 May 2010)

 

TechPsychic: So why iTunes App lets Social Networks Verizon Wireless Internet. (07 May 2010)

more »

 

SF Gate

 

APNewsBreak: Komen exec quits after funding flap (2012-02-07T19:44:17PST)

 

Why S.F. still counts on street fire alarm boxes (2012-02-07T19:44:17PST)

 

A U.S. appeals court rules Prop. 8 unconstitutional (2012-02-07T19:44:17PST)

 

Gingrich hits Romney, Obama, on Catholic rights (2012-02-07T19:44:17PST)

 

Job openings jump to near a 3-year high (2012-02-07T19:44:17PST)

 

Apple TV product may be imminent, analyst says (2012-02-07T19:44:17PST)

 

Russia Seeks to Prod Syria's Assad After Blocking UN Vote (2012-02-07T19:44:17PST)

 

Man stabbed to death in S.F. homeless shelter (2012-02-07T19:44:17PST)

 

Job openings jump to near a 3-year high (2012-02-07T19:42:25PST)

 

Stocks turn higher on strong job openings (2012-02-07T19:42:25PST)

 

Oracle rejects SAP award, demands new trial (2012-02-07T19:42:25PST)

 

Catholic hospitals split on giving contraceptives (2012-02-07T19:42:25PST)

 

Time for taxes means time for questions (2012-02-07T19:42:25PST)

 

BofA Investor Suit Over Merrill Deal Granted Class Status (2012-02-07T19:42:25PST)

more »

 

Asia Times Online

 

Pakistan snubs US over Osama informer (7 Feb 2012)

 

Obama switches play on war with Iran (7 Feb 2012)

 

Gulf crisis ripples across the globe (7 Feb 2012)

 

US weighs options as Syrian violence rises (7 Feb 2012)

 

Kidnaps highlight urgent task for China (7 Feb 2012)

 

Beijing finds vulnerable ally in Berlin (7 Feb 2012)

 

Kicking down the world's door (7 Feb 2012)

 

Chinese give boost to illegal ivory trade (7 Feb 2012)

 

Confidence in Nabucco fades (7 Feb 2012)

 

Obama may win on pessimism (7 Feb 2012)

 

THE BEAR'S LAIR : The government bubble (7 Feb 2012)

more »

 


Site feed Updated: 2012-Feb-07 14:00