parallel computing

S

Sori Schwimmer

Hi All,

While working on a project, I discovered lots of
little opportunities for real parallelism. For
instance, the following class initialization:

from pg import DB

class example:
def __init__(self):
# find somehow HOST1, HOST2

self.member1=DB('database1',host=HOST1).query("SELECT...").getresult()
self.member2=self.my_aux_func()
# some more processing here

self.member3=DB('database1',host=HOST2).query("SELECT...").getresult()
# other things here

will ask other physical computers to do some of the
work... and wait for the results.

Wouldn't be nice, in the spirit of occam (the
language) to do it like the following?

from pg import DB

class example:
def __init__(self):
# find somehow HOST1, HOST2
par:

self.member1=DB('database1',host=HOST1).query("SELECT...").getresult()
seq:
self.member2=self.my_aux_func()
# some more processing here

self.member3=DB('database1',host=HOST2).query("SELECT...").getresult()
# other things here

I know, we have thread(s), but is not the same. Things
built in the language are faster, as they are
C-compiled rather than Python-interpreted. The syntax
is pretty simple and expressive. It simply gives, IMO,
more power to the programmer.

Is it worth for a PEP?

Regards,
Sorin Schwimmer

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top