This discussion is archived
2 Replies Latest reply: Feb 24, 2012 4:44 PM by greybird RSS

KVStore - thread safty and reuse

919916 Newbie
Currently Being Moderated
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 Expert
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    Thanks for the answers!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points