FiberTaskingLib icon indicating copy to clipboard operation
FiberTaskingLib copied to clipboard

OS X Thread Affinity is unimplemented

Open ruby0x1 opened this issue 10 years ago • 13 comments

I've made progress on this and will PR soon with an implementation.

ruby0x1 avatar Sep 02 '15 01:09 ruby0x1

Curious: what is the status of this issue? Did it ever get attention?

amesgames avatar Jan 29 '18 06:01 amesgames

It's stalled. I haven't heard back from underscorediscovery. That said, my brief look into OSX thread affinity suggests that it's not possible from the kernel level. OSX purposely doesn't allow you to set the affinity.

RichieSams avatar Jan 29 '18 06:01 RichieSams

Hey apparently I slept on this. here's a post on how http://yyshen.github.io/2015/01/18/binding_threads_to_cores_osx.html

ruby0x1 avatar Jan 29 '18 06:01 ruby0x1

If my local build of this still compiles I can try update and PR for that piece, was there a test (to confirm affinity) in place @RichieSams?

ruby0x1 avatar Jan 29 '18 06:01 ruby0x1

Not currently, but I could whip one up this week. It would just spin up threads and compare their thread ids to check uniqueness.

RichieSams avatar Jan 29 '18 06:01 RichieSams

@RichieSams that'd be helpful, I think it'd make sure it's consistent on all targets going forward.

ruby0x1 avatar Jan 29 '18 06:01 ruby0x1

Definitely. Will do

RichieSams avatar Jan 29 '18 06:01 RichieSams

Thanks, a ton, you two.

My small team will be experimenting with Fibers and perhaps we can assist with some of the other open issues.

amesgames avatar Jan 29 '18 16:01 amesgames

Awesome!

RichieSams avatar Jan 29 '18 18:01 RichieSams

Affinity tests for Windows and Linux are implemented: https://github.com/RichieSams/FiberTaskingLib/tree/test_updates

RichieSams avatar Feb 10 '18 19:02 RichieSams

Alright cool, I'll use that as a jumping point.

ruby0x1 avatar Feb 11 '18 02:02 ruby0x1

OSX Affinity is theoretically implemented. It needs the tests though. And verification that I did it right. I've only tried it on a VM.

RichieSams avatar Feb 11 '18 03:02 RichieSams

ah ok, missed that bit, I'll have a run at it

ruby0x1 avatar Feb 11 '18 03:02 ruby0x1