Closed VCommitter closed 5 years ago
Internal testing results:
VcaEnableBlockingSockets
fixes reproducers of #60 problems 100% of the time
VSingleCoreExecution
settingVSingleCoreExecution
fixes known reproducers of #61 97%-99% of the time
V::VRandom::BoundedValue
doesn't link in debug mode for some reason. For some reason the templates are not getting instantiated. Ain't nobody got time for this...
Yup... The templates are only being instantiated for 32 and 64 bit unsigned integers. The link error should go away if you make cpu_count an unsigned int (64-bits seems a little eager and CPU counts < 0 ... hmmm, don't know what to do with that one :-)
For sure my comments were superficial as I got into your details. I am a little more likely than most to remember that those routines exist. At least it helps keep the spirit of DRY alive :-)
Thanks @MichaelJCaruso . I was digging through headers trying looking for any #if DEBUG
statements that would make a difference. But obviously the actual difference was that the function itself was optimized out in release mode.
Turns out digging through the headers for an hour was a valuable exercise. I definitely learned some things about the way the code is setup. Maybe I'm less likely to "RY" now...
Hey @MichaelJCaruso , now that I've made the changes you suggested do you have any other concerns or is this good to go? I've tested it extensively on this end.
…s to fix github issues #60 and #61.
You have to call sched_setaffinity before the first libV managed thread is spawned. Because sched_setaffinity modifies a thread specific attribute, not a process specific attribute. From the docs:
"The affinity mask is actually a per-thread attribute that can be adjusted independently for each of the threads in a thread group. The value returned from a call to gettid(2) can be passed in the argument pid. Specifying pid as 0 will set the attribute for the calling thread, and passing the value returned from a call to getpid(2) will set the attribute for the main thread of the thread group."