At 9:10 AM -0700 2001/06/26, Steve Mann wrote:
>Before I Start looking through the Data Manager Source code: does anyone know whether
>Data Manager calls are atomic.
>
>By that I mean, if I'm adding a record to a database using DmNewRecord, and I get a
>launch code (from wherever) that requires that I add another record using
>DmNewRecord, while in the middle of the first call to DmNewRecord, can the database
>be hosed?
Data manager calls are protected by a common semaphore such that each DmXXX call must
complete before the next is allowed to begin. This allows multiple simultaneously
active kernel tasks to safely access databases, though this is something currently
only HotSync and specific Licensee's products are allowed to do (legally anyway). The
actual calls themselves are not truly atomic, in that if the device were to be
rebooted during certain data manager operations, such as compacting the storage heap,
data corruption could result (i.e. the data manager does not implement rollback and
recovery type operations, as it's simply a layer on top of the memory manager).
In any case, your application cannot receive a launch code until it returns to its
main event loop and calls EvtGetEvent, so the semaphore mechanism isn't actually
relevant to the question. But you asked. ;o)
Regards,
Jim Schram
Palm Incorporated
Partner Engineering
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/