vision-dbms / vision

The master repository for the Vision database system.
https://vision-dbms.com
BSD 3-Clause "New" or "Revised" License
27 stars 12 forks source link

Implement VSingleCoreExecution and VcaEnableBlockingSockets as option… #65

Closed VCommitter closed 5 years ago

VCommitter commented 5 years ago

…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."

VCommitter commented 5 years ago

Internal testing results:

VCommitter commented 5 years ago

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...

MichaelJCaruso commented 5 years ago

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 :-)

VCommitter commented 5 years ago

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...

VCommitter commented 5 years ago

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.