×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    7

    Arrow using threads...

    hello folks, i see that a lot of codes about bluetooth make use of threads and synchronize, and i would like to know in what cases i need to use "threads" and "synchronize"?, why are they necessary?, i think it is very important to know why, thanks in advance, soraya.

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: using threads...

    hi,

    not having bluetooth experience yet I only say that some methods are blocking and you simply need to execute them in different thread than GUI thread,
    also if you have device waiting for connection you need to run wait loop in separate thread,
    review samples provided by nokia with SDKs,
    for general overview of threads/locks in context of J2ME (microedition) you can look here:
    http://developers.sun.com/techtopics...ng2/index.html

    regards,
    Peter

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    7

    Thumbs up Re: using threads...

    thanks Peter very much for your support, Soraya.

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: using threads...

    the rule basically is that you can't block the main thread. It's forbidden.
    you must not call blocking methods in the main thread, nor retain it for too long.
    for example, when commandAction is called, it must not be too long, and try to return asap.
    after the first chapter given by peter, i suggest this one : http://developers.sun.com/techtopics...les/threading/
    which covers a real example on the good use of thread, and a little of synchronisation (using several thread processing different things basically requires synchronisation when it come to put results together)

Similar Threads

  1. Use of CConsoleBase with multiple threads
    By stichbury in forum Symbian
    Replies: 2
    Last Post: 2006-03-02, 01:20
  2. Threads problem in Nokia 6620
    By delipsingh in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-09-22, 18:53
  3. Memory leak/stack growth in kernel threads?
    By yoalat in forum Symbian
    Replies: 0
    Last Post: 2004-08-10, 23:17
  4. Replies: 2
    Last Post: 2004-07-19, 12:39
  5. Replies: 0
    Last Post: 2003-08-29, 12:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×