lkml.org 
[lkml]   [2004]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: what to use (sem/spinlock/etc)....
RANDAZZO@ddc-web.com wrote:

> I have a register on my hardware that I write to to increment a counter....
> ..all I want to do is make sure that only one "task" writes at a time,
> thus to not corrupt the value......
>
> =EXAMPLE
>
> Task A
> - Write new Value to hardware
> - Increment Hardware counter
> - DONE
>
> Task B
> - Write new Value to hardware
> - Increment Hardware counter
> - DONE
>
> ..This will most likely not occur in a inthandler, but may....
>
> ...I have to make sure that Task A is "done" before "Task B" or any others
> can do their writing....
>
> ...any opinion of what I should use....

You can read the "Unreliable Guide To Locking" from Rusty Russell at:

http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/

I hope this helps,

--
Paulo Marques - www.grupopie.com

"In a world without walls and fences who needs windows and gates?"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.045 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site