Date: Wed, 14 Apr 2004 20:34:58 +0300 (EEST) From: Jari Kirma <kirma@cs.hut.fi> To: freebsd-threads@freebsd.org Subject: Co-operative process yield/handoff syscall? Message-ID: <Pine.GSO.4.58.0404142018490.24624@hutcs.cs.hut.fi>
next in thread | raw e-mail | index | archive | help
I have been considering implementing concurrent queues between processes or between kernel driver and process(es) while attempting to removing unnecessary system calls and context switches in general. There are several good algorithms for this, FreeBSD has machine/atomic.h which provides nice atomic operations for both kernel and userland (which supposedly don't work nicely with MP Itanium without some help from kernel side, though). After reading some papers on the subject, I read one [1] which states that sched_yield that doesn't necessarily yield CPU to other runnable process if one exists can cause considerable performance hit on these algorithms. Quick look at FreeBSD kernel suggested me that sched_yield really yields CPU only if there's higher-priority process runnable. Is there any good way to emulate the co-operative "handoff" system call suggested on the paper? Primary feature of such a system call would be to avoid returning to the same process after sched_yield if any other runnable processes exist. I suppose inside a multithreaded process, pthread_yield performs what's expected in this case. [1] E. Unrau and O. Krieger, "Efficient Sleep/Wake-up Protocols for User-Level IPC", <http://citeseer.ist.psu.edu/295181.html> -kirma
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.58.0404142018490.24624>