UnQLite Users Forum

Delete

(Leave this as-is, it’s a trap!)

To delete this post you must be either the original author or a designated moderator.
The content of the post will be removed but the name and date will remain.

  • The post will be removed completely from the thread, rather than blanked
  • Only posts on the last page of the thread can be removed completely (so as to not break permalinks)

RE[5]: Multithreading for Linux

shiva

Hallo Chm,

I am reopening the thread to discuss about the Concurrent Write and Read operations on the database.

I have enabled the Multithreading.
1. In one thread I am trying to Store different data in the Database using an array of keys. I am doing a Database commit as soon as I store any data and also closing the database between 2 stores and reopening again for any fresh operations.

2. While the Store is ongoing after some time I start my 2nd thread which Tries to Retrieve the data from this database using the same keys. I am opening the database in another handle using UNQLITE_OPEN_READONLY attribute. Now the read should happen as the Retrieves are concurrently possible. But, still I get UNQLITE_BUSY which means the database reads are not concurrent even though I have enabled the multithreading. Am I going somewhere wrong??

I am using the unqlite_lib_is_threadsafe to check if multithreading is enabled and also making sure not to configure it as Single thread using Liunqlite_lib_config.

Sorry!! I did not provide any code sample. But, its just a serial Write and a Serial Read from 2 different threads.

Your friendly neighbourhood moderators: chm_at_symisc, devel_at_symisc