![]() |
| | #31 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
|
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
| | #32 |
| Guest Join Date: Aug 2001
Posts: 4,923
| >> I believe svchost comprises nearly 300 separate threads/processes in XP and almost double that in Vista. Are you serious? That's crazy. What a waste of resources! |
| Sebastiani is offline | |
| | #33 |
| int x = *((int *) NULL); Join Date: Jul 2003 Location: Banks of the River Styx
Posts: 891
| My Build 7000 version of Windows 7 had ~215 threads across 11 processes. That's about how many threads my entire Linux system has...
__________________ long time; /* know C? */ Unprecedented performance: Nothing ever ran this slow before. Any sufficiently advanced bug is indistinguishable from a feature. Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31. The best way to accelerate an IBM is at 9.8 m/s/s. recursion (re - cur' - zhun) n. 1. (see recursion) |
| Cactus_Hugger is offline | |
| | #34 |
| (?<!re)tired Join Date: May 2006 Location: Portugal
Posts: 5,220
| You must remember that svchost.exe is a specialized service for hosting processes that run of DLLs, Sebastiani. The fact that these services run under the same process actually conserves memory and optimizes its use. The disadvantage is that if any of these services crashes, the entire svchost process that is hosting that service is almost certainly going down, taking all the other services with it. If you go to HKLM\SYSTEM\CurrentControlSet\Services, you'll get a list of installed services. Clicking on each may reveal a key called ImagePath. If that key points to svchost.exe, that's a service that is going to be hosted by this process. Meanwhile, you can run a command line and type tasklist /svc. This will let you know which services are being used by each of the svchost processes you are currently seeing in your task manager. You can also go to HKLM\Software\Microsoft\Windows NT\CurrentVersion\Svchost. This is where the services groupings are described. Finally, the Process Explorer from Sysinternals will give you all the details about each svchost process, including the individual services and total number of threads. EDIT: Currently I'm running 129 threads on 7 svchost images (or groups, or processes , or whatchacallit) hosting 31 services. Seems pretty decent to me. As some of these services wake up from idle time, I'd expect the number of threads to climb considerably. I believe Bubba means the potential of threads/processes. Not an actual constant number across a normal windows session.
__________________ Originally Posted by brewbuck: Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster. Last edited by Mario F.; 07-08-2009 at 06:40 PM. |
| Mario F. is offline | |
| | #35 |
| Algorithm Dissector Join Date: Dec 2005 Location: New Zealand
Posts: 2,476
| This is why they made the Vista defragmenter show you almost nothing while it works. Too many people asking stupid questions. Process Explorer FTW! |
| iMalc is offline | |
| | #36 | ||
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,099
| Quote:
If you kill svchost.exe, at least on XP, you will initiate an automatic reboot due to critical system services having been stopped. I believe in Vista and forward, Windows can recover from it. Nevertheless, if you kill them, they will just restart.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| ||
| Elysia is offline | |
| | #37 |
| Guest Join Date: Aug 2001
Posts: 4,923
| >> You must remember that svchost.exe is a specialized service for hosting processes that run of DLLs, Sebastiani. The fact that these services run under the same process actually conserves memory and optimizes its use. I know, I was merely shocked at the actual number of threads that it was running. I use Windows 2000, and the total number of svhost threads number less than 25! In fact, my entire system at this very moment has less than 115 threads executing *total*. I guess it's possible that newer versions of Windows have simply broken these down further to make things more efficient, but from my experience, at least, more threads != more efficiency, generally (there are exceptions, of course). Or perhaps the significant increase in threads is due to a dramatic increase in functionality, but from what I've seen with XP and Vista, aside from some of the more advanced graphics, I really don't see much of an improvement in that area to warrant such an increase in threads, IMO. Having said that, I always keep the number of services that run at a minimum, so I suspect that the default is much higher than the numbers I posted. And as far as Systernals goes, I've been using their products for a number of years, and in fact Process Explorer *is* my task manager. |
| Sebastiani is offline | |
| | #38 |
| Guest Join Date: Aug 2001
Posts: 4,923
| >> If you kill svchost.exe, at least on XP, you will initiate an automatic reboot due to critical system services having been stopped. That's true of Win2K, as well. I suspect it has something to do with the fact that Windows uses the RPC mechanism internally and so literally cannot run without it. |
| Sebastiani is offline | |
| | #39 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
| Yes I was not indicating that there are always a set number of threads running, however, the potential for a great number does exist and your task manager won't show them as anything but an instance of svchost. This is quite deceptive. So when you see that you have 40 processes running in task manager keep in mind the actual number lurking behind those svchost instances is considerably more. Usually when your system is sluggish or erratic and yet you cannot see anything in task manager that is causing it I would suspect it's one of the processes/threads being hosted by svchost. I really did not understand svchost till a friend of mine at Microsoft explained exactly what it was. I know that Vista at least has the potential to spawn off twice as many processes/threads through svchost as XP does. This is one of the many reasons that Vista is so slow. Also if you have a bunch of developers thinking they can just use svchost to host their process it quickly becomes abused and over-used and you end up having far more being hosted than is necessary. So if the system is extremely sluggish and unresponsive this is the first place I would look for the answer. I've also heard that many of these probably use DDE which could hamper performance even more. In short it started out as a great idea and has many benefits as Mario pointed out but it has been turned into a bit of a mess. The biggest issue is most certainly what Mario again pointed out. If any of the processes/threads crash that the svchost instance is hosting it is entirely possible your system will come crashing down as well since that svchost is more than likely hosting far more than just the offending process or thread. I have never programmed anything that actually uses svchost so my experience with it is pretty much limited to what I've been told firsthand and what I've read about it on the internet. Microsoft does have a tool to view all current threads and processes but it does not make clear which ones belong to which instances of svchost. However it can give you a better picture of your system.
__________________ If you aim at everything you will hit something but you won't know what it is. Last edited by Bubba; 07-10-2009 at 04:51 PM. |
| Bubba is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What the hell!? Crashes and memory leaks? | pobri19 | C++ Programming | 3 | 09-26-2008 05:45 AM |
| operator from hell | algi | A Brief History of Cprogramming.com | 16 | 12-24-2004 07:36 AM |
| DLL Hell | Sentaku senshi | Windows Programming | 9 | 11-21-2002 08:06 AM |
| Living in the 00'S | mithrandir | A Brief History of Cprogramming.com | 3 | 01-21-2002 09:31 AM |
| Heaven, Hell, and Aetheists/Non-believers | Aran | A Brief History of Cprogramming.com | 34 | 09-10-2001 02:18 PM |