Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How many threads?

Reply
Thread Tools

How many threads?

 
 
Tom Anderson
Guest
Posts: n/a
 
      08-04-2008
On Mon, 4 Aug 2008, Christian wrote:

> Tom Anderson schrieb:
>> On Sun, 3 Aug 2008, Roger Lindsjö wrote:
>>
>>> Roedy Green wrote:
>>>> I am about to do some multithreading code to get some parallelism when
>>>> waiting for Internet links to respond. The question comes How many
>>>> threads? Well it depend on too many things. How much ram, how fast the
>>>> connections, what else is going on in the machine.
>>>
>>> But hundreds is often no problem.
>>>
>>> Note: I have run this on Dual and Quad core Intel and AMD on Linux, not
>>> Windows, so there could be a difference.

>>
>> I believe that linux's threading is much, much faster than windows'. But a
>> few hundred threads could still be fine on windows.

>
> Does this believe have any base? Or is it just the usual Unix/Windows
> flame?


Stuff i read on the linux kernel mailing list a few years back. Which is
not necessarily an affirmative answer to your first question!

I can't cite proper data on this, i have to confess. We ought to extend
this thread to a linux and a windows newsgroup ...

tom

--
Imagine a city where graffiti wasn't illegal, a city where everybody
could draw wherever they liked. Where every street was awash with a
million colours and little phrases. Where standing at a bus stop was never
boring. A city that felt like a living breathing thing which belonged to
everybody, not just the estate agents and barons of big business. Imagine
a city like that and stop leaning against the wall - it's wet. -- Banksy
 
Reply With Quote
 
 
 
 
Tom Anderson
Guest
Posts: n/a
 
      08-04-2008
On Mon, 4 Aug 2008, Roedy Green wrote:

> and try to fit it say to a Cheyenne polynomial to try to predict the
> optimal value.


What's a Cheyenne polynomial? I don't think i've come across those.

tom

--
Imagine a city where graffiti wasn't illegal, a city where everybody
could draw wherever they liked. Where every street was awash with a
million colours and little phrases. Where standing at a bus stop was never
boring. A city that felt like a living breathing thing which belonged to
everybody, not just the estate agents and barons of big business. Imagine
a city like that and stop leaning against the wall - it's wet. -- Banksy
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      08-04-2008
Tom Anderson wrote:
> On Mon, 4 Aug 2008, Christian wrote:
>
>> Tom Anderson schrieb:
>>> On Sun, 3 Aug 2008, Roger Lindsjö wrote:
>>>
>>>> Roedy Green wrote:
>>>>> I am about to do some multithreading code to get some parallelism when
>>>>> waiting for Internet links to respond. The question comes How many
>>>>> threads? Well it depend on too many things. How much ram, how fast the
>>>>> connections, what else is going on in the machine.
>>>>
>>>> But hundreds is often no problem.
>>>>
>>>> Note: I have run this on Dual and Quad core Intel and AMD on Linux,
>>>> not Windows, so there could be a difference.
>>>
>>> I believe that linux's threading is much, much faster than windows'.
>>> But a few hundred threads could still be fine on windows.

>>
>> Does this believe have any base? Or is it just the usual Unix/Windows
>> flame?

>
> Stuff i read on the linux kernel mailing list a few years back. Which is
> not necessarily an affirmative answer to your first question!
>
> I can't cite proper data on this, i have to confess. We ought to extend
> this thread to a linux and a windows newsgroup ...
>
> tom
>


Sorry I came to this thread late but I remember here a while back I did
some experiments on the number of threads on Windows XP. I found once
you got past 75-100 things got really slow. That was on my dual core
machine and one with more processors would probably do much better.

I think in many cases you might do much better with schedulers and fewer
threads. Less system overhead and memory use.

--

Knute Johnson
email s/nospam/knute2008/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-05-2008
On Mon, 04 Aug 2008 19:17:34 GMT, Roedy Green
<(E-Mail Removed)> wrote, quoted or indirectly quoted
someone who said :

>say to a Cheyenne polynomial


Ack. He is butchering my messages too. That said "Chebychev" in the
original.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Tom Anderson
Guest
Posts: n/a
 
      08-05-2008
On Tue, 5 Aug 2008, Roedy Green wrote:

> On Mon, 04 Aug 2008 19:17:34 GMT, Roedy Green
> <(E-Mail Removed)> wrote, quoted or indirectly quoted
> someone who said :
>
>> say to a Cheyenne polynomial

>
> Ack. He is butchering my messages too.


Ah. Oh dear.

> That said "Chebychev" in the original.


Oh, i see. That i can find on wikipedia. Although it still doesn't make a
huge amount of sense to me!

tom

--
Computation is the basis of all life
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-05-2008
On Tue, 5 Aug 2008 17:10:22 +0100, Tom Anderson <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>Oh, i see. That i can find on wikipedia. Although it still doesn't make a
>huge amount of sense to me!


Chebychev polynomial approximation is sort of polynomial curve fit,
but better behaved than ordinary polynomials. They behave more like
real-world curves do.

The problem with curve fitting is in tends to work well for
interpolation but goes wildly up or down off the ends for
extrapolation. Probably reading up on mathematical techniques for
safe extrapolation might be in order.

My idea is thought that if you make an "error", adjusting the number
of threads in a way that makes throughput worse, feedback will soon
pull you back. You can consider any failure a worthwhile data
gathering expedition.

Probably almost any heuristic will work fine so long as you don't
increase or decrease the thread count by too much at a pop.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Joshua Cranmer
Guest
Posts: n/a
 
      08-05-2008
Roedy Green wrote:
> On Tue, 5 Aug 2008 17:10:22 +0100, Tom Anderson <(E-Mail Removed)>
> wrote, quoted or indirectly quoted someone who said :
>
>> Oh, i see. That i can find on wikipedia. Although it still doesn't make a
>> huge amount of sense to me!

>
> Chebychev polynomial approximation is sort of polynomial curve fit,
> but better behaved than ordinary polynomials. They behave more like
> real-world curves do.


To be more precise, Chebyshev polynomials spread out the interpolation
points to favor the end more, as regular polynomial interpolation near
the ends of the range tends to oscillate wildly. That phenomenon is
Runge's Phenomenon. Wikipedia has a good diagram of that, but it doesn't
have one of the Chebyshev interpolation...

> My idea is thought that if you make an "error", adjusting the number
> of threads in a way that makes throughput worse, feedback will soon
> pull you back. You can consider any failure a worthwhile data
> gathering expedition.


Doesn't sound like it would work if the were several local extrema. Then
again, the graph (ignoring noise) would probably have only one extrema
to begin with...


--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      08-05-2008
In article <JW0mk.289$xv.43@trnddc02>,
Joshua Cranmer <(E-Mail Removed)> wrote:

> Roedy Green wrote:
> > On Tue, 5 Aug 2008 17:10:22 +0100, Tom Anderson <(E-Mail Removed)>
> > wrote, quoted or indirectly quoted someone who said :
> >
> >> Oh, i see. That i can find on wikipedia. Although it still doesn't make a
> >> huge amount of sense to me!

> >
> > Chebychev polynomial approximation is sort of polynomial curve fit,
> > but better behaved than ordinary polynomials. They behave more like
> > real-world curves do.

>
> To be more precise, Chebyshev polynomials spread out the interpolation
> points to favor the end more, as regular polynomial interpolation near
> the ends of the range tends to oscillate wildly. That phenomenon is
> Runge's Phenomenon. Wikipedia has a good diagram of that, but it doesn't
> have one of the Chebyshev interpolation...

[...]

Thanks, I hadn't seen this compelling graph before:

<http://en.wikipedia.org/wiki/Runge's_phenomenon>

From there, I see that "roots of the Chebyshev polynomial ... are often
used as nodes in polynomial interpolation ... to minimize the problem of
Runge's phenomenon":

<http://en.wikipedia.org/wiki/Chebyshev_nodes>

Which leads to an interesting contrast here:

<http://en.wikipedia.org/wiki/Approximation_theory>

[I'm still laughing over my earnest search for "Cheyenne polynomials,"
now enshrined in my browser's history!]

--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Many-to-many relationship / DataSet / child rows / DataRelation / sorting / navigation Marco Ippolito ASP .Net 0 10-11-2004 04:11 PM
Re: Cisco PIX many-to-many NAT problem Fredy Kuenzler Cisco 1 07-16-2004 07:30 PM
Cisco PIX many-to-many NAT problem Fredy Kuenzler Cisco 4 06-15-2004 07:06 PM
How many questions (avg) and How many can i miss? Josh MCSD 2 02-16-2004 07:25 AM



Advertisments