2 Replies Latest reply: Feb 24, 2012 6:44 PM by Greybird-Oracle RSS

    KVStore - thread safty and reuse

    919916
      Hi,

      I searched a while but can't find any relevant information for the following two questions:

      1. Is it necessary to hold on to KVStore instance and reuse it when possible or is it efficient enough just call KVStoreFactory.getStore(kconfig) every time to get the store?
      2. Can the KVStore instance be used by multiple thread?

      Thanks in advance!
        • 1. Re: KVStore - thread safty and reuse
          Greybird-Oracle
          1. Is it necessary to hold on to KVStore instance and reuse it when possible or is it efficient enough just call KVStoreFactory.getStore(kconfig) every time to get the store?
          Best to hold on to the instance, unless that's not practical. The instance holds state information, a background thread, etc, so it would be best to create it infrequently.
          2. Can the KVStore instance be used by multiple thread?
          Yes.

          --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
          • 2. Re: KVStore - thread safty and reuse
            919916
            Thanks for the answers!