OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 5:16 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Atomicity/atomic stuff
PostPosted: Sat Nov 02, 2002 3:53 am 
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.


Top
  
 
 Post subject: Re:Atomicity/atomic stuff
PostPosted: Sat Nov 02, 2002 4:56 am 
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.


Top
  
 
 Post subject: Re:Atomicity/atomic stuff
PostPosted: Sat Nov 02, 2002 12:19 pm 
Awww... okay. Thanks for explianing that and for the link to the other thread Schol. :)

K.J.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 98 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group