Re: simple long long var operation atomic on 32 bit systems?
- From: "mliptak" <Mehturt@xxxxxxxxx>
- Date: 7 Mar 2007 22:50:12 -0800
On Mar 8, 6:50 am, "David Schwartz" <dav...@xxxxxxxxxxxxx> wrote:
On Mar 7, 5:20 am, "mliptak" <Meht...@xxxxxxxxx> wrote:
The question really makes no sense. I know of no platform where it'sI don't get this. What is not allowed? The C code the OP posted?
even legal. (POSIX, for example, prohibits one thread from accessing a
variable while another thread is or might be modifying it. So it's not
just not thread safe and not atomic, it's not allowed at all.)
By the POSIX pthreads standard, it is not allowed if another thread
might be accessing the variable at the same time. If another thread
cannot access the variable at the same time, it is perfectly safe, but
then why would you care if it's atomic or not?
So the question must be referring to some threading standard other
than POSIX threads. In POSIX threads, the answer is simply that one
thread is not permitted to modify a variable while another thread
might be accessing it.
DS
Ok I thought you're saying the implementation of pthreads thread won't
access a variable while other thread is modifying it ;)
m
.
- Follow-Ups:
- Re: simple long long var operation atomic on 32 bit systems?
- From: David Schwartz
- Re: simple long long var operation atomic on 32 bit systems?
- References:
- simple long long var operation atomic on 32 bit systems?
- From: Felix Kater
- Re: simple long long var operation atomic on 32 bit systems?
- From: David Schwartz
- Re: simple long long var operation atomic on 32 bit systems?
- From: mliptak
- Re: simple long long var operation atomic on 32 bit systems?
- From: David Schwartz
- simple long long var operation atomic on 32 bit systems?
- Prev by Date: Re: how to get the max number of pthread in a process?
- Next by Date: synchronization: mutex, sempahore, lockfree, spinlocks..
- Previous by thread: Re: simple long long var operation atomic on 32 bit systems?
- Next by thread: Re: simple long long var operation atomic on 32 bit systems?
- Index(es):
Relevant Pages
|
|