http://qs321.pair.com?node_id=441431


in reply to Multithreading Parsers

Don't read this. Read BrowserUK's reply. I'm wrong... but I learned something!

Just as an aside, since it hasn't been mentioned explicitly: I have no experience with AIX, but my guess is that it can only shift processes to different processors, but not threads, as a process can't run (efficiently) on two different processors. So if you use the divide & conquer strategies mentioned, make sure you fork().

Replies are listed 'Best First'.
Re^2: Multithreading Parsers
by BrowserUk (Patriarch) on Mar 22, 2005 at 13:27 UTC
    but my guess is that it can only shift processes to different processors, but not threads, as a process can't run (efficiently) on two different processors.

    Why do you say that?

    To quote from this AIX Programming Guide:

    On a uniprocessor system, threads execute one after another in a time-sliced manner. This contrasts with a multiprocessor system, where several threads execute at the same time, one on each available processor. Overall performance is improved by running different process threads on different processors. However, an individual program cannot take advantage of multiprocessing, unless it has multiple threads.

    Indeed, I am not aware of any flavour of *nix that supports POSIX threads that does not allow threads to run on all available cpu's? Nor am I aware of any efficiency problems inherent in doing so.

    Is this just FUD or do you know something I don't?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco.
    Rule 1 has a caveat! -- Who broke the cabal?
Re^2: Multithreading Parsers
by perlfan (Vicar) on Mar 22, 2005 at 15:26 UTC
    That is why I say forget about threads here :). Additionally, if you want to figure out if you'll get any benefit out of the whole "divide and conquer" approach, check out the master's theorem.
      That is why I say forget about threads here :).

      Because you haven't got a clue what your talking about?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco.
      Rule 1 has a caveat! -- Who broke the cabal?