Article View: news.software.readers
Article #80393[slrn] better multi-process slrnpull
From: Jurriaan (note: this is a workin...
Date: Fri, 15 Jun 2001 18:18
Date: Fri, 15 Jun 2001 18:18
72 lines
2606 bytes
2606 bytes
I've updated the multi-processing support in my slrn-0.9.7.1-jwk patch
from a simple 'each group has its designated process' scheme to a scheme
that tries to make sure all process are kept busy until the end.
The very simple version:
int group = 1;
int maxgroups = 50;
int procs;
int maxprocs = 5;
pid_t pid;
procs = 0;
while (group < maxgroups)
{
pid = fork();
if (pid == -1)
{
fprintf(stderr,"error in fork()\n");
}
else if (pid == 0)
{
/* in child */
handle_group(group);
_exit(0);
}
/* in parent */
procs++;
/* are we busy enough? */
if (procs == maxprocs)
{
(void)wait();
procs--;
}
group++;
}
/* clean up; there may be children running yet */
while (procs > 0)
{
(void)wait();
procs--;
}
The results with 4 Megabytes worth in 97 groups:
1 process 472 seconds, 8802 BPS
2 process 306 seconds, 13649 BPS (+55% to speed)
3 process 273 seconds, 15322 BPS (+75% to speed)
4 process 281 seconds, 14929 BPS (+70% to speed)
5 process 277 seconds, 15223 BPS (+73% to speed)
This is on a 64 kBaud ISDN-line with LZS compression.
I think 3/4 processes is enough, given my examples here.
I'm not sure if this solves Rudi's problems with leafnodes, so if there
are any leafnode-users with slrn out there that could test this, I'd be
grateful.
The patch is at http://www.xs4all.nl/~thunder7
Good luck,
Jurriaan
--
BOFH excuse #85:
Windows 95 "feature"
GNU/Linux 2.4.5-ac14 SMP/ReiserFS 2x1402 bogomips load av: 0.41 0.11 0.03
Technical Details
Message-ID:
<slrn9ikjm4.165.no_spam_here@middle.of.nowhere>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn9ikjm4.165.no_spam_here@middle.of.nowhere> Subject: [slrn] better multi-process slrnpull Date: Fri, 15 Jun 2001 18:18:48 +0000 From: no_spam_here@rivierenland.xs4all.nl (Jurriaan (note: this is a working address!)) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mail Newsgroups: news.software.readers Organization: XS4ALL Internet BV Lines: 71 NNTP-Posting-Host: rivierenland.xs4all.nl X-Trace: news1.xs4all.nl 992629128 14609 194.109.14.47 (15 Jun 2001 18:18:48 GMT) X-Complaints-To: abuse@xs4all.nl NNTP-Posting-Date: 15 Jun 2001 18:18:48 GMT X-Face: b$-F+98,@$_I=*ODq'<K2(OA)qC&,(GP=z2^`4dwQwy&e;!|R?>")k9FH3?YC+%*kF\=<Rx"Hy2_eyMtnFSiO8 User-Agent: slrn/0.9.7.1-jwk (Linux)