lkml.org 
[lkml]   [1998]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: test_and_set_bit() not atomic forever? [cli/sti in char/vt.c [patch]]
Hi!

> >Don't think so. Well, it is safe on i386, but on other architectures,
> >test_and_set_bit is not guaranteed to be atomic. [And I'm afraid that
>
> Arggh I thought that test_and_set_bit() was atomic on all ports (since I
> looked only its i386 implementation)!

Mistake.

> At first I can see test_and_set_bit() very more helpful if
> implemented atomic.

I was told that atomic test_and_set_bit would be too expensive on sparc.

> As second since it' s declared _not_ atomic in Linux, why i386 implement
> it atomic?

Because in i386 port it _IS_ atomic, so in arch/i386 you can assume
that test_and_set_bit is atomic. Strange, is not it? Should be
documented somewhere.

Pavel

--
I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

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