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. Advertising

  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. Advertising

  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. Advertising

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. Rohit

    j2me and RMS

    Rohit, Apr 2, 2004, in forum: Java
    Replies:
    1
    Views:
    994
    Darryl L. Pierce
    Apr 2, 2004
  2. Peter Trei
    Replies:
    0
    Views:
    356
    Peter Trei
    Jun 10, 2004
  3. swy128
    Replies:
    2
    Views:
    869
    Simon Brooke
    Nov 8, 2006
  4. Replies:
    2
    Views:
    4,477
  5. maaz
    Replies:
    0
    Views:
    349
Loading...

Share This Page