windows service and cpu infinity

  • Thread starter Thread starter Analizer1
  • Start date Start date
A

Analizer1

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
 
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?
 
Analizer1 said:
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

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.
 
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.
 
Fredo said:
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.

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.
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top