Re: sx locks and memory barriers

2009-09-25 Thread Robert Noland
On Fri, 2009-09-25 at 00:49 +0200, Fabio Checconi wrote: > Hi all, > looking at sys/sx.h I have some troubles understanding this comment: > > * A note about memory barriers. Exclusive locks need to use the same > * memory barriers as mutexes: _acq when acquiring an exclusive lock > * and _re

Re: sx locks and memory barriers

2009-09-25 Thread Ryan Stone
The code that Fabio proposes looks like this: sx_slock(&data->lock); if (data->buffer) a = *data->buffer; sx_sunlock(&data->lock); This point is that without a memory barrier on the unlock, the CPU is free to reorder the instructions into the order is his message. ___

Testers wanted: xterm-style emulator!

2009-09-25 Thread Ed Schouten
Hi folks, I just committed a small patch for the Syscons terminal emulator that allows you all to test an xterm-style terminal emulator without requiring any recompilation of your kernel (just make sure you run HEAD at r197481 or later). I am considering making the xterm-style emulator the defaul

Re: sx locks and memory barriers

2009-09-25 Thread Robert Noland
On Fri, 2009-09-25 at 09:30 -0400, Ryan Stone wrote: > The code that Fabio proposes looks like this: > > sx_slock(&data->lock); > if (data->buffer) > a = *data->buffer; > sx_sunlock(&data->lock); > > > This point is that without a memory barrier on the unlock, the CPU is > free to reorder th