|
#1
| |||
| |||
| How to set CPU affinity (taskset)? I understand that Leopard has more sophisticated processor affinity capabilities and I am wondering if there is a way to get to that from a C-level API (and from the command line). The reason I want this is to limit the functionality of a free version of a product (e.g., Oracle Express Edition and and Microsoft SQL Server Express Edition) so that it runs on only one CPU, no matter how many are on the machine. This way we can let developers use the real product for development and small projects, but we can charge when scaling is needed. James |
|
#2
| ||||
| ||||
| As far as I know, Microsoft SQL Server Express Edition does not run on Mac OS X. Are you running Mac OS X or Windows on your Mac computer?
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
|
#3
| |||
| |||
| Is there a way to set CPU affinity on Mac OSX 10.5? I am not trying to run SQL Server on Mac OSX. I am trying to set CPU affinity using a C API for a competing product that has a similar licensing model but runs on Macintosh OSX 10.5. |
|
#4
| ||||
| ||||
| Ah, I see... Apple has a few APIs that can help out with thread affinity, but I don't know whether you can set a process to only run on one core or another. http://developer.apple.com/releaseno...N-AffinityAPI/
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
| The Following User Says Thank You to ElDiabloConCaca For This Useful Post: | ||
JGFoster (August 20th, 2008) | ||
|
#5
| |||
| |||
| The release notes were helpful and come close to what I need. Thread affinity (as opposed to process affinity) would be fine. The only problem I see is in the notes where it says "Threads with affinity tags will tend to remain in place" (emphasis added). Since my goal is actually performance degradation(!), I wonder if the OS will move threads if my preferred CPU is busy. |
|
#6
| ||||
| ||||
| It's possible, but I don't know enough about Mac OS X's thread/processor management to say one way or the other. I know what you're talking about on the Windows-side, though -- with the ability to "tell" a certain process to only use Core 1, or Processor 2, or the like. I think since Mac OS X is a much more heavily threaded operating system with a different way of managing processes that the kind of control you're looking for may not exist, or may be managed in a completely different way, without control over specific processors or cores.
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
|
#7
| ||||
| ||||
| Would it be possible to have the limited version of your program only use one thread? If you did, it would effectively limit the program to one core, since OS X can't split a single thread across two cores. |
|
#8
| |||
| |||
| No. The application (an enterprise object database) at a minimum runs a dozen processes, each of which can have multiple threads. The idea is to run the exact same software that is used by existing customers (who currently run thousands of processes across hundreds of machines). We can set CPU affinity on Linux, so have an easy way to license a free version with confidence that customers will contact us when they need to scale their application. |
![]() |
| Tags |
| leopard cpu affinity |
| Thread Tools | |
|
|