Android Question Multi service classes & threading ?

Discussion in 'Android Questions' started by wl, Mar 9, 2015.

  1. wl

    wl Well-Known Member Licensed User


    I am writing a B4A app that will be using 2 background services (both 'StartAtBoot' BTW).
    Both services access the same storage file (keyvaluestore). One will be putting data in the storage and 1 will be removing from the storage.

    Will both services run in their own thread and to be thread-safe should I access the keyvalue store in a callsubdelayed ?

    Or should I use AGraham's threading library and use a semaphore to
    - open the keyvaluestore file
    - add or remove data
    - save the keyvalue store file ?

  2. Erel

    Erel Administrator Staff Member Licensed User

    All of your code runs in the same thread. You do not need to worry about threading issues.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice