![]() |
|
|
#1 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
11101011001102 Posts |
Any out there?
I'm somewhat lazy. Does anyone know the Mac OS X C code to: 1) Get amount of physical memory installed 2) Get thread ID 3) Set thread affinity 4) Set thread priority 5) Find battery vs. AC power state |
|
|
|
|
|
#2 |
|
"Mark"
Apr 2003
Between here and the
11·577 Posts |
nice() should be able to set the priority.
|
|
|
|
|
|
#3 |
|
25·52·7 Posts |
Since I'm also lazy and not a Mac OS X programmer, I will just give you some hints and pointers to the appropriate documentation:
1) sysctl(3) is your friend (HW_PHYSMEM): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html 2) pthread_self(3) might help: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/pthread_self.3.html 3) sorry, no clue (and couldn't find anything on apple's site using a quick search) 4) I don't know nice() as a C routine, but just as a command line tool which sets the priority of a process, better suited might be a sequence of pthread_getschedparam(3) and pthread_setschedparam(3): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/pthread_setschedparam.3.html or perhaps even simpler pthread_attr_getschedparam(3) and pthread_attr_setschedparam(3): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/pthread_attr_setschedparam.3.html also helpful might be the man page for setpriority(2): http://developer.apple.com/documenta...riority.2.html 5) no clue. An index of man pages can be found there: http://developer.apple.com/documentation/Darwin/Reference/ManPages/index.html Sections 2 and 3 are the most relevant to C programming. I will continue to search for solutions to questions 3) and 5) - as I'm waiting since January for a Mac OS X GIMPS client. But I hope this might help at least a bit... |
|
|
|
#4 | |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2·53·71 Posts |
Quote:
Do not use it to contact the server. If you are real lucky, it might can do some manual tests. |
|
|
|
|
|
|
#5 | |
|
"Ethan O'Connor"
Oct 2002
GIMPS since Jan 1996
9210 Posts |
Quote:
George -- It seems to work fine! I haven't done exhaustive testing, but the menu works as expected, benchmarks and torture test work fine, and cpu detection seems to be accurate. All noted on a very early MacBook Pro running 10.4.9. Thanks! Ethan O'Connor (Primenet EO) |
|
|
|
|
|
|
#6 | |
|
"Ethan O'Connor"
Oct 2002
GIMPS since Jan 1996
22·23 Posts |
Quote:
Code:
[Apr 30 22:17] Torture Test ran 10 hours, 42 minutes - 0 errors, 0 warnings. [Apr 30 22:17] Work thread stopped. [Apr 30 22:17] Execution halted. Again, this is on a 1.83GHz Core Duo MacBook Pro running 10.4.9. |
|
|
|
|
|
|
#7 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
11101011001102 Posts |
You may not care but multi-threaded FFTs don't work. I'm trying to figure out why.
|
|
|
|
|
|
#8 | |
|
"Ethan O'Connor"
Oct 2002
GIMPS since Jan 1996
22·23 Posts |
Quote:
When the program is in this state (and sometimes when it is not) there appears to be stack corruption in the main thread, at least according to the activity monitor's sampling profiler. I've been too busy to verify if that's actually true or is an artifact of something else. Let me know if I can be of any assistance -- can you build a debug version and put it on the ftp site? Ethan |
|
|
|
|
|
|
#9 | |
|
Sep 2002
23×37 Posts |
Quote:
this is for intel based macs right? |
|
|
|
|
|
|
#10 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2×53×71 Posts |
|
|
|
|
|
|
#11 |
|
Sep 2002
1001010002 Posts |
is there any feed back you need specifically?
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Looking for MAC GPU programmers | ET_ | GPU Computing | 16 | 2013-11-10 19:45 |
| Advice for programmers | davieddy | Software | 43 | 2011-03-29 08:46 |
| PS3 programmers(program conversion for pay?) | jasong | Programming | 5 | 2007-12-16 00:10 |
| request for script(programmers please read) | jasong | Sierpinski/Riesel Base 5 | 6 | 2005-05-11 20:09 |