* Daniel Eischen <[EMAIL PROTECTED]> [071002 19:46] wrote:
> On Tue, 2 Oct 2007, Alfred Perlstein wrote:
> 
> >Hi guys, we need critical sections for userland here.
> >
> >This is basically to avoid a process being switched out while holding
> >a user level spinlock.
> 
> Setting the scheduling class to real-time and using SCHED_FIFO
> and adjusting the thread priority around the lock doesn't work?

Too heavy weight, we want to basically have this sort of code
in userland:

/* assume single threaded process for now */
static int is_critical;



atomic_mutex_lock();  /* implies ++is_critical */
 ...do stuff...
atomic_mutex_unlock(); /* implies --is_critical */

We don't want two or more syscalls per lock operation. :)

-- 
- Alfred Perlstein
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to