×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    When to you thread ?

    Hello experts,
    As I was going thru sample apps that comes with J2ME and I noticed many of them creates one or more threads to handle send/recv end-points. I'm just wondering whether there are any rules/restrictions behind this or just a design choice ? I'm well aware of the advantage of the multi-threading in general. But in JME world, is it "required" that the communication must be done from a separate (non-UI) thread ?

    thanks
    ~b

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

    Re: When to you thread ?

    hello b,

    that's basic rule when UI (user interface) comes to place:
    take Windows program, you cannot start non-asynchronous, time consuming operation within event handler for user driven event because it wont handle action/exit until process ends,
    The same on devices (and even has more impact due to limited information user can have about what's going on compared to desktop machine where we can always do [CTRL+ALT+DELETE]>>task manager, ect),
    Also by default all operations in MIDP runs within main midlet thread unless you start them in dedicated thread - so even without user interaction if process is started it will block application responsivness for user action,

    very nice article from Sun about that which describe that with network connectivity as base scope:
    http://developers.sun.com/techtopics...ing/index.html

    hth,
    regards,
    Peter

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    Re: When to you thread ?

    thank you Peter, that was very useful information, especially the link.

    very much appreciated.
    ~b

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

    Smile Re: When to you thread ?

    you're welcome b

Similar Threads

  1. console app running problem
    By xcompass in forum Symbian
    Replies: 3
    Last Post: 2009-05-08, 13:26
  2. Link errors when trying to Display bitmap
    By Bkc82 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-01-16, 22:46
  3. Thread function not being called
    By kamalsinghania in forum Symbian
    Replies: 5
    Last Post: 2006-01-04, 12:28
  4. Thread
    By Kalderas in forum Symbian
    Replies: 4
    Last Post: 2003-08-14, 15:02
  5. Can't start thread function
    By liuhoihing in forum Symbian
    Replies: 0
    Last Post: 2003-05-05, 06:35

Posting Permissions

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