Paul Corke wrote:
> On 10 October 2012 13:47, Richard Hipp wrote:
>> We would also love to have guidance on alternative techniques for
>> obtaining memory shared across multiple processes that does not
>> involve mmap() of temporary files.
>
> In case it's any use, what we use on Linux is:
>
>     ftok(P) -- presumably you could use the sqlite file as the first
> argument
>
>     shmget(P) -- using the id generated by ftok(), and using IPC_CREAT
> if needed

With 32-bit keys, there's quite a high risk of collisions.  You should
rather use shm_open() (which is spec'd by POSIX and implemented by all
modern Unixes except Net/OpenBSD).

On Android, neither shmget nor shm_open are accessible, and the native
shared memory mechanism (ashmem) would require exchanging file
descriptors through RPC.  There really is no alternative to mmap().
(Furthermore, there is no shared tmpfs directory, so that temp file
must be created in the same directory as the DB file itself.)


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to