🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #533

Re: Threading

#533
From: Owen Green
Date: Tue, 12 Aug 2003 15:12
36 lines
2432 bytes
Oliver Young wrote:

> 
> > How exactly do you plan to use the extra CPU time?
> I'm trying to send as much as it is possible e-mails per minute. I'd
> like to start more threads if there is a lot of free CPU time. I
> belive number of started threads is dependant of CPU power. Am I
> wrong?

Quite possibly; the optimum number of worker threads in such a system
will also be affected by contention for shared resources between
threads (i.e. how much time threads spend waiting for resources to
become available) and, in this case, the network.

How are these e-mails being sent? Are you performing mx lookups, or
just fowarding to an SMTP server? In the first case it makes some sense
to have multiple threads processing jobs, although the network and the
machine will still have an affect on how many it's worth having. In the
second case, everything's being pushed to a single socket anyway, so
network access (at least) will have to be single-threaded.


> > Surely if your other threads are busy enough they will
> > consume all available CPU.
> Yes, but I was thinking that I should start 5 threads on P II 450
> MHz, and 15 threads on P III 1,0 GHz, and 30 threads on P4 2,4 GHz.
> Am I wrong?

Depends what they're doing, whether they're all doing it at the same
time, etc etc.

There are no hard and fast numbers in concurrency requirements, even
for a given machine - it depends upon work load as well.

If you describe a bit more about your architecure (provided this isn't
spam software :) I'll try and make some more concrete reccomendations.
Technical Details
Message-ID: <3f3903d4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f38e1a6$1@newsgroups.borland.com> <3f38e5e8$1@newsgroups.borland.com> <3f38ea50@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,e26fc8182223ac82
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-08-12 08:22:34 PST
From: "Owen Green" <o.t.green@ntlworld.com>
Subject: Re: Threading
Newsgroups: borland.public.jbuilder.java.api
References: <3f38e1a6$1@newsgroups.borland.com> <3f38e5e8$1@newsgroups.borland.com> <3f38ea50@newsgroups.borland.com>
User-Agent: XanaNews/1.15.3.2
NNTP-Posting-Host: 62.253.133.169
Message-ID: <3f3903d4$1@newsgroups.borland.com>
Date: 12 Aug 2003 08:12:20 -0700
X-Trace: newsgroups.borland.com 1060701140 62.253.133.169 (12 Aug 2003 08:12:20 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail