kamesankamesan Posted December 18, 2016 Share Posted December 18, 2016 Hi, i have a program that use 100% of all Threads of my CPU. It become impossible to do anything else on this machine when processing. I wan't to disabled the affinity of the first and the second for that process. I can find a lot of example to use the first and the second, like: ;_WinAPI_SetProcessAffinityMask($hProc, 0x01) ;Set affinity for 1-st core ;_WinAPI_SetProcessAffinityMask($hProc, 0x02) ;Set affinity for 2-nd core _WinAPI_SetProcessAffinityMask($hProc, 0x03) ;Set affinity for both cores ... but how to do the inverse? My machine is 56 threads! Thank you for your help. Link to comment Share on other sites More sharing options...
careca Posted December 21, 2016 Share Posted December 21, 2016 What happens if you set the affinity to all but those? i understand that you say it uses all, but i just mean, set affinity "on top" of it. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Andreik Posted December 21, 2016 Share Posted December 21, 2016 How many cores do you have? And on which core(s) do you want to run your process? For example if you have 4 cores and you want to run just on cores 3 and 4 then your mask will be 0x0C. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
kamesankamesan Posted December 24, 2016 Author Share Posted December 24, 2016 (edited) Thank you for your interest. I have 14 cores x 2 hyperthreaded, so 56 threads. I wan't to disabled the first 4 threads of an running process. It will be great if this script could work not depending of the maximum threads a machine have. Because i would like to run on several machine that have different number of cores. But everytime, i want the same thing: disabled the first 4 threads on a specific process. I Hope it is clear... Thank you for your help. Edited December 24, 2016 by kamesankamesan Link to comment Share on other sites More sharing options...
kamesankamesan Posted December 25, 2016 Author Share Posted December 25, 2016 (edited) Ok, i understand now that 56 threads affinity is 72057594037927935 in decimal number. But Autoit handle decimal number in 32bits. So it can't set all cpu affinity... max seem to be: 4294967295 (32 threads) Any idea? Thx Edited December 26, 2016 by kamesankamesan Link to comment Share on other sites More sharing options...
kamesankamesan Posted December 26, 2016 Author Share Posted December 26, 2016 (edited) Hmm, i'm trying a different way.... Correct me please if i'm wrong. 0x00FFFFFFFFFFFFFF = 56 THREADS? 0x00FFFFFFFFFFFFFC = 56 THREADS - first 2 THREADS ? 0x00000000FFFFFFFF = 32 THREADS 0x00000000FFFFFFFC = 32 THREADS - first 2 THREADS ? 0x000000000000FFFF = 16 THREADS 0x000000000000FFFC = 16 THREADS - first 2 THREADS ? 0x00000000000000FF = 8 THREADS 0x00000000000000FC = 8 THREADS - first 2 THREADS ? Edited December 26, 2016 by kamesankamesan Link to comment Share on other sites More sharing options...
kamesankamesan Posted December 26, 2016 Author Share Posted December 26, 2016 That seems to be exact but unfortunantely it can't parse more that 32 THREADS again... 0xFFFFFFFF is max. I suppose for the same reason: autoit int32 numbers.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 26, 2016 Moderators Share Posted December 26, 2016 kamesankamesan, Please stick to just the one thread - and certainly do not resurrect any more 9-year old ones. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kamesankamesan Posted December 26, 2016 Author Share Posted December 26, 2016 Sorry to disturb you with my double post I tought it wasn't impolite because my problem is no more "all Cpu's affinity except one". I found the way. But because i use the script from the 9 year old post, i tought it was better to warn there about the uncompatibility with more than 32 cores machine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now