multi threading in multi processor (computer)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Donn Cave

    #31
    Re: Kill GIL

    In article <cur9q3$or$1@pa nix3.panix.com> , aahz@pythoncraf t.com (Aahz)
    wrote:
    [color=blue]
    > Yes. I just get a bit irritated with some of the standard lines that
    > people use.[/color]

    Hey, stop me if you've heard this one: "I used threads to solve
    my problem - and now I have two problems!"

    Donn Cave, donn@u.washingt on.edu

    Comment

    • Aahz

      #32
      Re: Kill GIL

      In article <donn-98901F.16083114 022005@gnus01.u .washington.edu >,
      Donn Cave <donn@u.washing ton.edu> wrote:[color=blue]
      >In article <cur9q3$or$1@pa nix3.panix.com> , aahz@pythoncraf t.com (Aahz)
      >wrote:[color=green]
      >>
      >> Yes. I just get a bit irritated with some of the standard lines that
      >> people use.[/color]
      >
      >Hey, stop me if you've heard this one: "I used threads to solve
      >my problem - and now I have two problems!"[/color]

      Point to you. ;-)
      --
      Aahz (aahz@pythoncra ft.com) <*> http://www.pythoncraft.com/

      "The joy of coding Python should be in seeing short, concise, readable
      classes that express a lot of action in a small amount of clear code --
      not in reams of trivial code that bores the reader to death." --GvR

      Comment

      • Dennis Lee Bieber

        #33
        Re: Kill GIL

        On Mon, 14 Feb 2005 16:08:31 -0800, Donn Cave <donn@u.washing ton.edu>
        declaimed the following in comp.lang.pytho n:
        [color=blue]
        >
        > Hey, stop me if you've heard this one: "I used threads to solve
        > my problem - and now I have two problems!"
        >[/color]
        <devil's advocate mode>

        Your employee was so impressed by the quickness of your first
        solution that he's assigned you twice as much work...

        </devil's advocate mode>

        --[color=blue]
        > =============== =============== =============== =============== == <
        > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
        > wulfraed@dm.net | Bestiaria Support Staff <
        > =============== =============== =============== =============== == <
        > Home Page: <http://www.dm.net/~wulfraed/> <
        > Overflow Page: <http://wlfraed.home.ne tcom.com/> <[/color]

        Comment

        • Adrian Casey

          #34
          Re: Kill GIL

          Aahz wrote:
          [color=blue]
          > In article <mailman.2502.1 108343142.22381 .python-list@python.org >,
          > Frans Englich <frans.englich@ telia.com> wrote:[color=green]
          >>
          >>Personally I need a solution which touches this discussion. I need to run
          >>multiple processes, which I communicate with via stdin/out,
          >>simultaneousl y, and my plan was to do this with threads. Any favorite
          >>document pointers, common traps, or something else which could be good to
          >>know?[/color]
          >
          > Threads and forks tend to be problematic. This is one case I'd recommend
          > against threads.[/color]

          Multiple threads interacting with stdin/stdout? I've done it with 2 queues.
          One for feeding the threads input and one for them to use for output. In
          fact, using queues takes care of the serialization problems generally
          associated with many threads trying to access a single resource (e.g.
          stdout). Python Queues are thread-safe so you don't have to worry about
          such issues.

          Comment

          • Peter Hansen

            #35
            Re: Kill GIL

            Adrian Casey wrote:[color=blue]
            > Aahz wrote:[color=green]
            >>Threads and forks tend to be problematic. This is one case I'd recommend
            >>against threads.[/color]
            >
            > Multiple threads interacting with stdin/stdout? I've done it with 2 queues.
            > One for feeding the threads input and one for them to use for output. In
            > fact, using queues takes care of the serialization problems generally
            > associated with many threads trying to access a single resource (e.g.
            > stdout). Python Queues are thread-safe so you don't have to worry about
            > such issues.[/color]

            Hee hee.... do you realize who you're writing these comments to?

            This is like someone telling _me_ I could be more effective using
            test-driven development to write my code... ;-)

            -Peter

            Comment

            • Martin Christensen

              #36
              Re: multi threading in multi processor (computer)

              -----BEGIN PGP SIGNED MESSAGE-----
              Hash: SHA1
              [color=blue][color=green][color=darkred]
              >>>>> "Irmen" == Irmen de Jong <irmen.NOSPAM@x s4all.nl> writes:[/color][/color][/color]
              Irmen> Naah. What about: http://www.razorvine.net/img/killGIL.jpg

              Some people have too much spare time and too weird senses of
              humour...

              Fortunately for the rest of us. :-) This one actually made me laugh
              out loud.

              Martin

              - --
              Homepage: http://www.cs.auc.dk/~factotum/
              GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt
              -----BEGIN PGP SIGNATURE-----
              Version: GnuPG v1.2.5 (GNU/Linux)
              Comment: Using Mailcrypt+GnuPG <http://www.gnupg.org>

              iEYEARECAAYFAkI SBcwACgkQYu1fMm OQldUg2QCgq1ATL CJWqAS7SBsHpcXT duma
              xjMAoII+AzDwkp2 F2NZvw4PUrBUx+G Dh
              =Yqjf
              -----END PGP SIGNATURE-----

              Comment

              • Aahz

                #37
                Re: Kill GIL

                In article <4211e287@duste r.adelaide.on.n et>,
                Adrian Casey <news@outbackli nux.com> wrote:[color=blue]
                >Aahz wrote:[color=green]
                >> In article <mailman.2502.1 108343142.22381 .python-list@python.org >,
                >> Frans Englich <frans.englich@ telia.com> wrote:[color=darkred]
                >>>
                >>>Personally I need a solution which touches this discussion. I need to run
                >>>multiple processes, which I communicate with via stdin/out,
                >>>simultaneous ly, and my plan was to do this with threads. Any favorite
                >>>document pointers, common traps, or something else which could be good to
                >>>know?[/color]
                >>
                >> Threads and forks tend to be problematic. This is one case I'd recommend
                >> against threads.[/color]
                >
                >Multiple threads interacting with stdin/stdout? I've done it with 2
                >queues. One for feeding the threads input and one for them to use
                >for output. In fact, using queues takes care of the serialization
                >problems generally associated with many threads trying to access a
                >single resource (e.g. stdout). Python Queues are thread-safe so you
                >don't have to worry about such issues.[/color]

                The problem is that each sub-process really needs its own stdin/stdout.
                Also, to repeat, forking tends to be problematic with threads. Finally,
                as Peter implied, I'm well-known on c.l.py for responding to thread
                problems with, "Really? Are you using Queue? Why not?" However, this
                is one case where Queue can't help.
                --
                Aahz (aahz@pythoncra ft.com) <*> http://www.pythoncraft.com/

                "The joy of coding Python should be in seeing short, concise, readable
                classes that express a lot of action in a small amount of clear code --
                not in reams of trivial code that bores the reader to death." --GvR

                Comment

                • Dennis Lee Bieber

                  #38
                  Re: Kill GIL

                  On Tue, 15 Feb 2005 05:53:01 GMT, Dennis Lee Bieber
                  <wlfraed@ix.net com.com> declaimed the following in comp.lang.pytho n:
                  [color=blue]
                  >
                  > Your employee was so impressed by the quickness of your first[/color]

                  ACK!

                  employeR

                  --[color=blue]
                  > =============== =============== =============== =============== == <
                  > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
                  > wulfraed@dm.net | Bestiaria Support Staff <
                  > =============== =============== =============== =============== == <
                  > Home Page: <http://www.dm.net/~wulfraed/> <
                  > Overflow Page: <http://wlfraed.home.ne tcom.com/> <[/color]

                  Comment

                  Working...