On Fri, 12 Mar 2010 02:22:31 -0800 (PST), GeoffW
<geoffw...@hotmail.com> wrote:

>Now I have got a half ported version of Sqlite up and running on MQX I cant
>put off any longer the question of file locking and how I tackle that ? For
>the moment i had made the xLock() and xUnlock() the same as in osWin.c
>version but with the Windows lock() and unlock() function calls commented
>The problem I have is that MQX's file system is just ANSI C, and it lacks
>any lock/unlock functions.
>As Sqlite has been ported to so many diverse operating systems I am hoping
>that this question of what to do for an ANSI only File system has already
>been hit and a workaround defined ?
>I am pretty hazy on this topic of file locking so I would appreciate some
>basic discussion and guidance. It might help if I explain my application a
>little. It is an embedded system where we are just running one application,
>but it is multithreaded. For my initial porting work I have made
>SQLITE_THREADSAFE = 0 (so I probably dont even need a file lock in the
>configuration I have at present ?)
>However I would of course like to make SQLITE_THREADSAFE = 1 so that
>multiple tasks can safely access a database.

(Disclaimer: this is not my specialism, I hope it helps

SQLITE_THREADSAFE has effect on threads within the same
process (=task), especially when they use the same
connection. You need file locks for synchronisation between
different processes. If the filesystem doesn't provide them,
you could use the dot lockfile paradigm, which seems to be

>Thanks for any guidance
>Regards Geoff
  (  Kees Nuyt
sqlite-users mailing list

Reply via email to