J2ME:Sharing RMS between threads

Discussion in 'Java' started by timnels@gmail.com, Sep 14, 2005.

  1. Guest

    I have a timer task that is getting GPS settings at a pre-defined
    interval and storing them in RMS. I have another thread that will be
    picking those entries up and pushing them up to a server on the
    Internet. From what I have read accessing these without a
    syncronization method is a no-no. What methods are people using to
    syncronize access to RMS? Also, is there a simple way to re-use record
    ID's so your RMS doesn't grow out of control?
    Thanks.
     
    , Sep 14, 2005
    #1
    1. Advertisements

  2. jan V Guest

    > I have a timer task that is getting GPS settings at a pre-defined
    > interval and storing them in RMS.


    What's RMS?
     
    jan V, Sep 14, 2005
    #2
    1. Advertisements

  3. Guest

    The J2ME/MIDP data storage class.
     
    , Sep 14, 2005
    #3
  4. jan V Guest

    <> wrote in message
    news:...
    > I have a timer task that is getting GPS settings at a pre-defined
    > interval and storing them in RMS.


    Thanks for clarifying what RMS is.

    > I have another thread that will be
    > picking those entries up and pushing them up to a server on the
    > Internet. From what I have read accessing these without a
    > syncronization method is a no-no. What methods are people using to
    > syncronize access to RMS?


    If the RMS doesn't provide some locking, i.e. synchronization, service
    itself, then you could use a plain Object to represent the RMS lock. As long
    as both producer and consumer sides of your architecture would "go through"
    (i.e. honour the lock semantics) the lock, then your records would never get
    corrupted or read partially. Using a plain Object with Java's thread
    snchronization support (wait/notify etc) is rather elementary...

    > Also, is there a simple way to re-use record
    > ID's so your RMS doesn't grow out of control?


    Circular list? Pool of IDs? I've got no experience of the J2ME platform, so
    maybe these suggestions are not feasible on such a restricted JVM.
     
    jan V, Sep 14, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dennis Gavrilov
    Replies:
    1
    Views:
    1,617
    Dennis Gavrilov
    Jul 24, 2003
  2. Ram P. Dash

    Sharing DLL between threads

    Ram P. Dash, May 27, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    815
    Ziga Jakhel
    May 31, 2005
  3. Rohit

    j2me and RMS

    Rohit, Apr 2, 2004, in forum: Java
    Replies:
    1
    Views:
    1,107
    Darryl L. Pierce
    Apr 2, 2004
  4. Peter Trei
    Replies:
    0
    Views:
    410
    Peter Trei
    Jun 10, 2004
  5. swy128
    Replies:
    2
    Views:
    976
    Simon Brooke
    Nov 8, 2006
  6. Replies:
    2
    Views:
    4,654
  7. patrick boulay
    Replies:
    7
    Views:
    7,524
    PatrickBlais
    Apr 2, 2009
  8. maaz
    Replies:
    0
    Views:
    425
Loading...