If your "properties" are independant of each other and the reader thread 
accessing intermediate values is not a problem, you can just continue (good 
luck is bound to run out in 15 years of non threadsafe operation).

Consider using atomic instructions to read/update single properties. If 
properties are required to conform to certain conditions (e.g. changing the 
value of one property requires a corresponding opposing change in another), the 
classical way would be to require that a mutex be obtained before reading 
and/or updating any of the "linked" properties and only released when the 
thread has finished whatever it was doing to them.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:[email protected]] Im 
Auftrag von heribert
Gesendet: Mittwoch, 20. September 2017 08:28
An: [email protected]
Betreff: [EXTERNAL] [sqlite] sqlite3_stmt limitations

Hello,

in my mfc application are 100-10,000 object properties (depending on app
setup) used by two threads. The properties are not threadsafe (most of them are 
doubles or int). Upto now (15 years running code) there was no problem. Only 
one thread writes to the properties.
Main thread accesses the properties every 5 msec. The second one accesses on 
demand (every 50-2000 msec).

Now i have to add an http server interface to my application. The server is 
running, but i'm not sure, if the last 15 years of not threadsafe access will 
be okay any longer. So i think about to store the properties in a sqlite memory 
database. The threads prepares their own sqlite3_stmt's with select statements 
to the properties currently needed
- to have fast access to the database values.

My question: Is their any limitation of sqlite3_stmt bound to a database? How 
much memory is used by a sqlite3_stmt?

Thx for any hint
heribert
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: [email protected]

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to