parallel computing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sori Schwimmer

    #1

    parallel computing

    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',ho st=HOST1).query ("SELECT...").g etresult()
    self.member2=se lf.my_aux_func( )
    # some more processing here

    self.member3=DB ('database1',ho st=HOST2).query ("SELECT...").g etresult()
    # 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',ho st=HOST1).query ("SELECT...").g etresult()
    seq:
    self.member2=se lf.my_aux_func( )
    # some more processing here

    self.member3=DB ('database1',ho st=HOST2).query ("SELECT...").g etresult()
    # 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
    Yahoo Mail: Your smarter, faster, free email solution. Organize your inbox, protect your privacy, and tackle tasks efficiently with AI-powered features and robust security tools.

Working...