in reply to Re: Tk and Threads (again)
in thread Tk and Threads (again)

but at the same time, threads impose a rather substantial overhead penalty as well because they force Perl to implement preemptive multitasking within a single process, which is no mean feat.

Not so. All the preemption and multitasking is done by entirely by the operating system, regardless of which OS it is running on. Perl uses either POSIX threads or Win32 native threads.

Unlike Java and several other langauges which do implement their own mini-schedulers within each process, Perl leaves all the scheduling to the OS.


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?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: Tk and Threads (again)
by Errto (Vicar) on Jan 23, 2006 at 03:28 UTC
    Huh. Didn't realize that. I guess after all of the (mostly negative) material I've read here about Perl threads I had assumed that they were totally in-process. Then it's possible I was doing something wrong to produce the clunky thread behavior I was seeing (with the timeslices not being distributed very well), or else Windows threads just do that. BTW, Java can be built with what they call "green" threads which are totally in-process but these days the default build uses native threads including NPTL on Linux.
      Then it's possible I was doing something wrong to produce the clunky thread behavior I was seeing (with the timeslices not being distributed very well),

      I don't suppose you retained the code?

      Unfortunately about 95% of the bad press that Perl's threads get is due to people writing poor code and then blaming threads. Or worse, people who have never attempted to write a threaded Perl program, reporting and re-reporting the same three bad experiences of those brave souls that did try them--over and over and over.

      or else Windows threads just do that.

      No, There is nothing wrong with windows scheduling. And that is even more pervasive.

      If those that have switched to Linux had put as much effort into understanding their win32 systems as they are forced to learn about their *nix systems before they can do the simplest task, they may well have found that they didn't need to switch in the first place.


      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?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.