Performance improvement of parallel applications with user-space spinlocks
2009-03-11 00:22:00 Author: arighi.blogspot.com(查看原文) 阅读量:6 收藏

tag:blogger.com,1999:blog-4397409626710913610.post4621337164116452580..comments2019-12-27T11:08:37.292+01:00Comments on arighi's blog: Performance improvement of parallel applications with user-space spinlocksarighihttp://www.blogger.com/profile/15223521151492879497[email protected]Blogger2125tag:blogger.com,1999:blog-4397409626710913610.post-89063001060229662492009-05-14T16:02:00.000+02:002009-05-14T16:02:00.000+02:00Righ. I've just fixed using a wrapper to the SYS_g...Righ. I've just fixed using a wrapper to the SYS_gettid syscall.<br /><br />Thanks for reporting!arighihttps://www.blogger.com/profile/15223521151492879497[email protected]tag:blogger.com,1999:blog-4397409626710913610.post-41724714577458180622009-03-28T14:45:00.000+01:002009-03-28T14:45:00.000+01:00I'm not sure that your calls to sched_setaffinity ...I'm not sure that your calls to sched_setaffinity are not doing what you want. You are doing thing:<BR/><BR/>pid_t pid = getpid();<BR/>sched_setaffinity(pid, ...);<BR/><BR/>This sets the affinity for the *main thread* only. Hence, if you were to observe this process using top or something similar, I think you would see that the worker threads are free to run on any CPU. If you want to set the affinity for the current thread, pass 0 or the value from gettid().<BR/><BR/>sched_setaffinity is a bit weird: it only operates on single threads, not entire processes.Evan Joneshttps://www.blogger.com/profile/02694440592772191857[email protected]

文章来源: http://arighi.blogspot.com/feeds/4621337164116452580/comments/default
如有侵权请联系:admin#unsafe.sh