Article View: borland.public.cppbuilder.nativeapi
Article #17568Re: Tweaking threads
From: Michael Kelly
Date: Fri, 14 Mar 2003 18:10
Date: Fri, 14 Mar 2003 18:10
25 lines
2215 bytes
2215 bytes
On Fri, 14 Mar 2003 04:14:11 GMT, Chris244@aol.com (Chris Hill) wrote: >Even 100 is a large number of threads. If your threads are often >blocked waiting for I/O it doesn't hurt to have quite a few to >simplify the sturcture of your code. If all of the hundreds of >threads are CPU bound, some percentage of the available CPU time will >be wasted with the administrative overhead of switching between the >threads. I haven't delved into how Win32 handles this(and maybe 9x is different than NT flavors) but I know in the old days when OS/2 2.x worried about being run on 386 machines they "cheated" by just switching the value in the TSS(this is just from memory so I may get the tasking mechanism wrong) instead of reloading all the valid info to try to cut down on the switching overhead. As I remember there were plenty of threads running, even when not all that much was going on. What killed it was when some communications sw tried to bump up priority to hog the CPU. I would think with Pentium+ machines it wouldn't be all that much of an issue. Processes might be another story where you really have to save some state. -- "Only choice is an oxymoron."
Technical Details
Message-ID:
<0o647vo3u75fvpojh04467i7tndkgptqhd@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e6deb3f@newsgroups.borland.com> <3e6e2fb9@newsgroups.borland.com> <3e70406f@newsgroups.borland.com> <3e712c22.1882140705@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,47731b28ebfc1a3 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-15 09:52:05 PST From: Michael Kelly <mkelly00@netzero.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Tweaking threads Date: Fri, 14 Mar 2003 13:10:20 -0500 Message-ID: <0o647vo3u75fvpojh04467i7tndkgptqhd@4ax.com> References: <3e6deb3f@newsgroups.borland.com> <3e6e2fb9@newsgroups.borland.com> <3e70406f@newsgroups.borland.com> <3e712c22.1882140705@forums.borland.com> X-Newsreader: Forte Agent 1.92/32.572 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.51.217.132 X-Trace: newsgroups.borland.com 1047665433 24.51.217.132 (14 Mar 2003 10:10:33 -0800) Lines: 25 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail