[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: the tokyocabinet testsuite takes ages



Samuel Thibault, on Thu 11 Feb 2016 14:50:17 +0100, wrote:
> Svante Signell, on Thu 11 Feb 2016 13:40:29 +0100, wrote:
> > I've found the problem: The configure flag: --enable-uyeild was added to -6, to 
> > enable race-condition detection, see
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812796
> 
> Ok. I guess we should make gnumach change its yield behavior to align
> more on the linux behavior, i.e. a program that yields still eats 100%
> CPU.

That's the case already. I guess the issue is that 

#if !defined(_POSIX_PRIORITY_SCHEDULING) && TCUSEPTHREAD
#define sched_yield()                    usleep(1000 * 20)
#endif

makes processes sleep for 20ms instead of just yielding.

We indeed do not have strict priority scheduling, only the classical
nice/SCHED_OTHER priorities, so defining _POSIX_PRIORITY_SCHEDULING is
not an option.

tokyocabinet however does not use these, so its demand for
_POSIX_PRIORITY_SCHEDULING seems exagerated, and they could perhaps
rather use

#if !defined(_POSIX_PRIORITY_SCHEDULING) && !defined(__GLIBC__) && TCUSEPTHREAD
#define sched_yield()                    usleep(1000 * 20)
#endif

Samuel


Reply to: