How do we handle data integrity issues with semaphores?

For example, lets say you are writing data to a database, and you also want to write a 
size to the database as well. 

I currently allocate the memory, write the data, then write the size.

However, since the OS is multi-threaded, the pager card, for example, could interrupt 
into the middle of this operation, add data to the storage memory, potentially fill up 
storage memory or crash, and then I am left with only the first write operation and 
not the second, and therefore corrupt data.

Are there any OS calls to prevent an interrupt at this level?

Shannon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hands High Software, Inc.

Award winning software for the Palm OS platform 

<http://www.handshigh.com/> 

[EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to