On 23-11-15 15:23, Richard Hipp wrote:
 > On 11/23/15, Johan W. Van Ooijen <jwvanooijen at kyazma.nl> wrote:
 >> On 23-11-15 15:01, Richard Hipp wrote:
 >>   > Try compiling with -DSQLITE_MEMORY_BARRIER=""
 >>
 >> This will produce an empty sqlite3MemoryBarrier() function; is such a
 >> memory barrier not necessary under 32-bit and/or 64-bit Windows?
 >>
 >
 > The necessity of a memory barrier is debated.  SQLite seemed to do
 > fine without one for 14 years.  Probably you will have no problems as
 > long as you invoke sqlite3_initialize() and let it run to completion
 > from a single thread before you do anything else with SQLite in any
 > other thread.
 >

Thanks. Memory barriers are beyond my expertise, I have to rely on 
others about this. My software runs lots of parallel threads that each 
can write to the same database table. Using sqlite3_mutex_enter() and 
sqlite3_mutex_leave() in SQLite 3.8.5 (which has no memory barriers) 
this worked fine, so probably you are right.

Currently I am in touch with Embarcadero to see what they can do. Memory 
barriers are implemented somewhere inside C++Builder, so it may be 
possible to enable them. Will inform you if they solve things.

Did you notice my comment about the too early definition of the macro 
SQLITE_OS_WIN in the amalgamation?

Regards,
Johan Van Ooijen
--


Reply via email to