parallel computing

Discussion in 'Python' started by Sori Schwimmer, Apr 25, 2006.

  1. 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
     
    Sori Schwimmer, Apr 25, 2006
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    619
  2. Replies:
    0
    Views:
    525
  3. optical supercomputing

    Optical Computing: special issue - Natural Computing, Springer

    optical supercomputing, Dec 19, 2008, in forum: C Programming
    Replies:
    0
    Views:
    581
    optical supercomputing
    Dec 19, 2008
  4. optical supercomputing

    Optical Computing: special issue - Natural Computing, Springer

    optical supercomputing, Jan 16, 2009, in forum: C Programming
    Replies:
    0
    Views:
    588
    optical supercomputing
    Jan 16, 2009
  5. Replies:
    0
    Views:
    890
  6. carlosp

    parallel computing in C++

    carlosp, Apr 25, 2009, in forum: C++
    Replies:
    8
    Views:
    2,109
    Chris M. Thomasson
    Apr 28, 2009
  7. carlosp

    parallel computing

    carlosp, Apr 25, 2009, in forum: C++
    Replies:
    0
    Views:
    385
    carlosp
    Apr 25, 2009
  8. WCECS 2009
    Replies:
    0
    Views:
    943
    WCECS 2009
    Feb 23, 2010
Loading...