mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* what to use (sem/spinlock/etc)....
@ 2004-02-16 13:10 RANDAZZO
  2004-02-16 15:20 ` Paulo Marques
  2004-02-16 15:21 ` Davide Libenzi
  0 siblings, 2 replies; 3+ messages in thread
From: RANDAZZO @ 2004-02-16 13:10 UTC (permalink / raw)
  To: linux-kernel

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....

 
"This message may contain company proprietary information. If you are not
the intended recipient, any disclosure, copying, distribution or reliance on
the contents of this message is prohibited. If you received this message in
error, please delete and notify me."


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: what to use (sem/spinlock/etc)....
  2004-02-16 13:10 what to use (sem/spinlock/etc) RANDAZZO
@ 2004-02-16 15:20 ` Paulo Marques
  2004-02-16 15:21 ` Davide Libenzi
  1 sibling, 0 replies; 3+ messages in thread
From: Paulo Marques @ 2004-02-16 15:20 UTC (permalink / raw)
  To: RANDAZZO; +Cc: linux-kernel

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?"


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: what to use (sem/spinlock/etc)....
  2004-02-16 13:10 what to use (sem/spinlock/etc) RANDAZZO
  2004-02-16 15:20 ` Paulo Marques
@ 2004-02-16 15:21 ` Davide Libenzi
  1 sibling, 0 replies; 3+ messages in thread
From: Davide Libenzi @ 2004-02-16 15:21 UTC (permalink / raw)
  To: RANDAZZO; +Cc: linux-kernel

On Mon, 16 Feb 2004 RANDAZZO@ddc-web.com wrote:

> ...any opinion of what I should use....

I'd say a spindoc:

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



- Davide



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-16 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-16 13:10 what to use (sem/spinlock/etc) RANDAZZO
2004-02-16 15:20 ` Paulo Marques
2004-02-16 15:21 ` Davide Libenzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®