Ubuntu and a multiprocessor environment
basilmarket.com forums :
Tech Talk
| 5 posts archived
thread starter Misacorp Aug 20 2010
+ PM | QUOTE | PERMALINK | REPORT
| Hey guys! I currently have a need to run a program (Java) under Ubuntu 10.4. The problem is that I want to run it so that only one of the four processor cores is working on it. I'll give you details if you wish, but if you have any idea how this could be done, please share Thanks! |
My Characters: Irrational - 52 KradiaEMS Wind Archer
ShiroNoYami 08/20/10
+ PM | QUOTE | PERMALINK | REPORT
| Can you do something like that? I wanna know, too; it sounds useful O: |
My Characters: negaiishi - 76 Khaini Sniper
angramainyu 08/21/10
+ PM | QUOTE | PERMALINK | REPORT
| schedtool -a <affinity> <pid> The affinity parameter may either be a hexadecimal bitmask where CPU0 is the least significant bit, or a list of integral values separated by commas. For instance, 0x5 (0000 0101) or 0,2 will enable execution of your process by CPU0 and CPU2. |
My Characters: AeshmaMainyu - 34 Khaini Dawn Warrior
Misacorp 08/21/10
+ PM | QUOTE | PERMALINK | REPORT
| So if I only wanted to make the first core run it, I'd enter "schedtool -a 0 <pid>"? |
My Characters: Irrational - 52 KradiaEMS Wind Archer
angramainyu
+ PM | QUOTE | PERMALINK | REPORT
| [quote] Misacorp : So if I only wanted to make the first core run it, I'd enter "schedtool -a 0 <pid>"? [/quote] Yes. I assume you understand the concept of process IDs; there is no need for me to explain the last parameter, is there? If you wish to restrict your application to a single core at each launch, a simple "start" script, which calls your schedtool command after launching the application, should suffice. Otherwise, you will have to obtain the PID and execute the command manually each time your application starts. |
My Characters: AeshmaMainyu - 34 Khaini Dawn Warrior
BasilMarket is Copyright 2004-2008 BasilMarket.com (archive reconstruction). Data recovered from the Internet Archive Wayback Machine for the Classic MapleStory community.