DB_THREAD support in Berkeley DB/glibc
David Edelsohn
dje at watson.ibm.com
Wed Dec 29 11:21:36 EST 1999
>>>>> Geoff Keating writes:
Geoff> We don't need 'isync', 'sync' will do just fine, and is faster. We
Geoff> are only concerned here with memory coherency. In fact, 'isync' does
Geoff> not imply 'sync' in a multiprocessor implementation; 'sync' does an
Geoff> extra broadcast on the bus. The PowerPC User's Manual says
Geoff> The sync instruction can be used to ensure that the result of all
Geoff> stores into a data structure, performed in a "critical section" of a
Geoff> program, are seen by other processors before the data structure is
Geoff> seen as unlocked.
Geoff> We probably want 'sync' before and after, although it's probable the
Geoff> 'after' is unnecessary.
"sync" is not faster; sync is a full context synchronization
instruction. As I had mentioned to David, the necessity of a sync *after*
the store depends on the semantics of this programming model. Maybe in
this context one should sync before acquiring the lock and then sync after
releasing the lock.
David
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-dev
mailing list