Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

windows service and cpu infinity

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Analizer1 - 25 Jan 2008 17:00 GMT
where can i read more  about cpu infinity
setting service level Information

I have some c# Services ive Completed and i want
to control the cpu in which they work with and other proerties....

Tks
Fredo - 25 Jan 2008 17:57 GMT
It's processor Affinity, not Infinity.

It's handled via the Windows API calls for SetThreadAffinityMask and
SetProcessAffinityMask. You probably won't be able to easily do it at the
thread level, as matching a managed thread to a thread handle is pretty
tough. Setting it for the entire process is pretty easy as the process
handle is easily obtained.

Do you mind if I ask why you want to do this?

> where can i read more  about cpu infinity
> setting service level Information
[quoted text clipped - 3 lines]
>
> Tks
Willy Denoyette [MVP] - 25 Jan 2008 20:51 GMT
> where can i read more  about cpu infinity
> setting service level Information
[quoted text clipped - 3 lines]
>
> Tks

Both the Process affinity and the Thread affinity can be set using the
System.Diagnostics namespace.
The *process* affinity can be set using ProcessorAffinity property of the
Process class, while the thread affinity can be set using the
ProcessorAffinity  property of the ProcessThread class.
Question is - why do you think you need this?

Willy.
Fredo - 25 Jan 2008 21:24 GMT
> Both the Process affinity and the Thread affinity can be set using the
> System.Diagnostics namespace.

Doh... I didn't even think to check to see if there were managed
equivalents. I just assumed there weren't because, well, hell, how often
does anyone every need to use it. I too am quite curious as to why the
poster wants to use it.
Willy Denoyette [MVP] - 25 Jan 2008 21:35 GMT
>> Both the Process affinity and the Thread affinity can be set using the
>> System.Diagnostics namespace.
[quoted text clipped - 3 lines]
> does anyone every need to use it. I too am quite curious as to why the
> poster wants to use it.

Well, IMO, these managed equivalents, shouldn't have been in the Framework
to begin with, user class applications never need these, and if you think
you need them, you are probably doing something wrong.

Willy.
Analizer1 - 26 Jan 2008 01:54 GMT
there Is No User interface........since these services are complete.....
top serivice ->thread manager->business logic (ie threads)
i may not need afinity....im still learning my optiions at the service
level...

so all your knowlege and response's are welcome
thanks

>>> Both the Process affinity and the Thread affinity can be set using the
>>> System.Diagnostics namespace.
[quoted text clipped - 9 lines]
>
> Willy.
Analizer1 - 26 Jan 2008 01:54 GMT
if i have multiple threads running and multi cpu....
I want to assign a process to a cpu...and also throttling....
the 7 Services i wrote..are all multi threaded ..for back end processing on
a busy web site......
i want to further add functionality to the services

Im just getting into all this..so lots of learning and reading ahead of me

thanks for your responses

>> where can i read more  about cpu infinity
>> setting service level Information
[quoted text clipped - 12 lines]
>
> Willy.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.