On Wednesday 23 November 2005 20:25, Iain Duncan wrote: > Thanks Istvan. Is this something that must be called for the whole > process from main, or can it be called in each thread? The architecture > of the host is basically the same as my examples, so main spawns several > threads, one handles fltk stuff and one calls csound. Do I call the > above from the main or the csound thread? It was originally intended to be used in the main thread at start-up. However, you can make the child threads inherit the real-time scheduling policy with something like: uintptr_t csound_thread_func(void *userData); int main(int argc, char **argv) { void *csound_thread, *userData; ... #ifdef LINUX if (set_rt_priority(98, 97, 10) != 0) error(); /* fail in some way */ #endif ... #ifdef LINUX { pthread_attr_t attr; pthread_t th; pthread_attr_init(&attr); pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED); pthread_create(&th, &attr, (void *(*)(void*)) csound_thread_func, userData); csound_thread = (void*) th; pthread_attr_destroy(&attr); } #else csound_thread = csoundCreateThread(csound_thread_func, userData); #endif > And do I then call this stuff: > > #ifdef LINUX > > { > > struct sched_param sp; > > // IV - Aug 27 2002: widget thread is always run with normal > > priority memset(&sp, 0, sizeof(struct sched_param)); > > pthread_setschedparam(pthread_self(), SCHED_OTHER, &sp); > > } > > #endif > > from the fltk thread? Yes. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net