[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Threaded??



|On Unix systems this is a really big deal since, if you are
|running a process which defines about 40k of environment
|variables that's an additional 40k each and every time a
|subprocess starts up.

This is one advantage of threads. The other is that context switch time
(the time it takes to tell one program to stop and another to start) is
generally much shorter with threads, so your computer spends less time
changing which program is currently running and more time actually
running your programs.

|On the Mac I don't think
|the difference is quite as dramatic as with Unix.

Actually, it's *much* worse on a Mac. Because Unix can share .text
sections, if you've got 3 copies of perl running, you've only got 1 copy
of perl's executable code. On a Mac, you'd have three copies (assuming
you made three copies of the MacPerl app and ran each of them). Also, on
Unix memory is allocated dynamically so a small script won't take much
memory. On the Mac, you get whatever is set in MacPerl's Get Info,
whether you need it or not. Finally, context switching on a Mac takes
*forever* (relatively speaking :-)), as the whole trap table and low
memory globals have to be swapped on a major context switch.

A threaded MacPerl would solve two of these--you'd only have one copy
of the MacPerl code running no matter how many scripts you have running
at once, and switching between threads should be much faster than
switching between applications.

Brian

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch