Re: Ya know Pan2 is really single threaded, right?

Duncan <[email protected]>
Newsgroups gmane.comp.gnome.apps.pan.devel
Message-ID <[email protected]>
"Calin A. Culianu" <[email protected]> posted
Pine.LNX.4.64.0703171509480.8682-EKXA4TvLwjlqX4L8qHOwfQ@public.gmane.org, excerpted below, on 
Sat, 17 Mar 2007 15:18:13 -0400:

> The other 4 threads that are created are only briefly used to create a
> socket connection to the nntp server, then the actual handshaking and
> logging-in is handled from the main thread's idle loop!
> 
> Furthermore, any and all nntp stuff happens in the main thread.  Sure,
> there are 4 task contexts that keep getting shuffled around, but
> basically only 1 task at a time ever runs, and it runs in the main
> thread.
> 
> Meanwhile, you have this perfectly lovely thread pool sitting there
> twiddling its thumbs.
> 
> Is this intentional?

It's known and intentional, yes.  Older pan (pre 0.9x, coded in C instead 
of C++) was indeed multithreaded in its downloading.

I'm not a C/C++ developer myself, and while I know a bit about thread 
concurrency issues and believe Charles probably decided it was just 
simpler (and still fast enough) to have it all single threaded to avoid 
them, I'm not privy to further details.  I'd be interested in seeing his 
answer, however. =8^)

Meanwhile, I've found it /much/ more my style and much less likely to 
stall ongoing downloads if in the binary groups I download everything to 
cache, then do local processing as a second round, after everything's 
already downloaded.  Of course, pan's default 10 MB cache isn't large 
enough for this, but that's easily solved by tweaking the setting in 
preferences.xml.  (As with several "advanced" settings, there's no way to 
tweak it in the GUI prefs, only by editing the config files directly.)

As I said, however, I've never seen Charles explain his choice, but 
expect I'd learn something about threading as well as about pan seeing 
it, so thanks for asking and hope he replies too. =8^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.