Do I need to lock a table during a FLUSH when using VSDK C++ API in multi-threaded app?

Matthew Jew mjew at icnc.com
Wed Aug 16 01:23:55 CDT 2006


On Aug 16, 2006, at 12:03 AM, Ivan Smahin wrote:

> Hello Matthew,
>
> Wednesday, August 16, 2006, 12:42:43 AM, you wrote:
>
>> Hello,
>
>> I am using the VSDK 2 C++ in a multi-threaded application on a
>> Macintosh.
>
>> I normally use the API way to work with the database tables, so I
>> make sure
>> that I use semaphores/locks on each individual table whenever I
>> either read, modify, or add records.
>
>> My question is this:
>> If I do a flush() on a database, do I need to lock the tables
>> contained in that database
>> to prevent other threads from potentially attempting to read, modify,
>> or add records at the same time?
>> Or is the flush() operation implemented so that it does not interfere
>> with other threads
>> potentially accessing the tables contained in the database being
>> flushed?
>
>> What are the rules about locking tables for exclusive access now that
>> Valentina 2 now
>> is more thread-friendly?
>
>
> Currently  you  need lock/unlock every "kernel" object to make sure be
> threading  safe.  So,  for  now,  global  mutex  seems to be most safe
> solution.
>

Ivan,

When you say I need to lock/unlock every "kernel" object, what does  
that mean exactly?

- Matthew




More information about the Valentina mailing list