thread scheduling priority
Petri Helenius
pete at he.iki.fi
Mon Jul 7 05:58:04 PDT 2003
I have two threads on a SMP (2 CPU, HT disabled) box with world+kernel
from mid-June. (cvsupping to latest right now) and a process which
runs two threads with the following code snippet, more or less in a process
& maintenance (collecting statistics, doing housekeeping, etc.) fashion.
While
the main thread does it's stuff it competes for a mutex with the other
thread. However
I'm observing that the thread created in the snippet below has hard time
getting
scheduled while the main thread is running.
Am I missing something? No rtprio stuff here, contention scope is the
default.
{
struct sched_param param;
pthread_attr_t attributes;
pthread_attr_init (&attributes);
pthread_attr_getschedparam (&attributes,¶m);
param.sched_priority += 5;
pthread_attr_setschedparam (&attributes,¶m);
pthread_create (&smem_thread,&attributes,&live_poll_sharedmem,0);
}
Pete
More information about the freebsd-threads
mailing list