This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DB_THREAD support in Berkeley DB/glibc


>>>>> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]