What are they in the programming world? I have been unable to find out anything about them except that they might have to do with allowing only one thing to mess with something at one time. Google has not been any help unfortunitly.
Thanks in advance,
K.J.
Atomicity/atomic stuff
Re:Atomicity/atomic stuff
While there are some nuances that are dependent on the particular area in question (mutual exclusion, database transaction control, network mail transfer, etc.), the general idea of an atomic event is one which cannot be interrupted partway through - it either happens or it doesn't, with no possibility of a partial or incomplete result. For example, in OS theory, a single assembly language instruction which locks the memory addressing bus would be considered atomic - once the instruction begins processing, any interrupts which occur get held until after the instruction goes to completion. In database transactions, an atomic transaction is one which is guaranteed to be in one of two states - completed or rolled back - at the end of transaction processing. In networking, an atomic transfer is one which ensures that a message either gets copied to the destination and removed from the source, or else remains at the source and not copied at the destination.
I am assuming that what you are really interested in is the former, and it's application towards mutual exclusion. What that comes down to is that, in order to manipulate certain flags or counters in a way that guarantees mutual exclusion, many processor (including the x86) provide special instructions which act to both change the variable and test the result as a single atomic action, without the need to explicitly block interrupts (though in a multiprocessor system, it may require the LOCK prefix to ensure that the memory bus is locked for exclusive use). The x86 instructions which can be used this way include XCHG, BTS, BTC, and BTR.
For more information on this and how these are used, consult any basic OS design text; for a few concrete examples, see the relevant discussion in this thread.
I am assuming that what you are really interested in is the former, and it's application towards mutual exclusion. What that comes down to is that, in order to manipulate certain flags or counters in a way that guarantees mutual exclusion, many processor (including the x86) provide special instructions which act to both change the variable and test the result as a single atomic action, without the need to explicitly block interrupts (though in a multiprocessor system, it may require the LOCK prefix to ensure that the memory bus is locked for exclusive use). The x86 instructions which can be used this way include XCHG, BTS, BTC, and BTR.
For more information on this and how these are used, consult any basic OS design text; for a few concrete examples, see the relevant discussion in this thread.
Re:Atomicity/atomic stuff
Awww... okay. Thanks for explianing that and for the link to the other thread Schol.
K.J.
K.J.