×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    159

    Regrading thread Error

    hi
    Every one how to resolve TOOManyThreadError Exception through j2me coding

  2. #2
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Regrading thread Error

    Hi sis1987,
    What kind of the exception you are getting ?
    What are you doing with the threads ?
    How many threads you are starting ?
    Give the problem description properly then only some one will helps you.

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Regrading thread Error

    Quote Originally Posted by sis1987 View Post
    hi
    Every one how to resolve TOOManyThreadError Exception through j2me coding
    Well,if there is any exception through the java code then indeed there must be some way to fix the same through the java code itself. ..

    How many threads you have started so far in the code?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    159

    Re: Regrading thread Error

    Actually i want to kill that thread .is it possible in j2me because in j2me i think this is not possible so how to do this.

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Regrading thread Error

    Quote Originally Posted by sis1987 View Post
    Actually i want to kill that thread .is it possible in j2me because in j2me i think this is not possible so how to do this.
    Well,tell us that have you fix that problem?
    if yes then how..if no then what is the issue still there?

    Simply you can kill the thread by just initialize the null to the current thread.
    if you have just one(as if you dont have 1 thread,you have multiple) then do like this

    threadName = null;

    write here for the more queries.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  6. #6
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Regrading thread Error

    Hi,
    Still ur not clearing ur problem. Do u think that we all were aware of ur code and exceptions came. Well to stop or killing the thread object just set it to null. If ur calling any unlimited loop in run then set that boolean false. But Still we r not aware of ur problem. If ur problem not get solved yet then please reply with full description of ur need and problem.

    Also check the way of initializing Thread object. Please post the steps where u get problem with the exceptions. Also post the step where u initialize the thread variable.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Regrading thread Error

    The way to fix "too many threads"... is to have fewer threads.

    First: avoid using threads unless you really know how threads work.

    Second: create the smallest number of threads you possibly can.

    You cannot stop a thread. A thread can only stop itself. A thread stops when its run() method ends. You must ensure that the run() method's closing "}" is reached (or a return statement), or the thread will run until the VM shuts down.

    Setting variables to null makes no difference at all to whether a thread is running or not. "mythread = null;" does not stop the thread.

    Cheers,
    Graham.

  8. #8
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    159

    Re: Regrading thread Error

    thanks to all ,

    I must ensure that the run() method's closing "}" is reached .But my probelm is still.
    BTW any one know what is circular buffer.

  9. #9
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: Regrading thread Error

    Ya its better to let the thread end gracefully. Avoid loops and locks in thread, and if u are using any make sure they break. Circular buffer is a concept, check out this link
    http://en.wikipedia.org/wiki/Circular_buffer
    au revoir
    Prakash Raman

  10. #10
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Regrading thread Error

    Quote Originally Posted by sis1987 View Post
    thanks to all ,

    I must ensure that the run() method's closing "}" is reached .But my probelm is still.
    BTW any one know what is circular buffer.
    Can you make sure that no other thread running out there?
    Why you need so many threads?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  11. #11
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    159

    Re: Regrading thread Error

    yes i am 100% sure and this is my project requirement.

  12. #12
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Regrading thread Error

    Hi,
    In order to kill the thread the suggestion by Grahm was great.why do not you follow the same...just return the run().
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  13. #13
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    159

    Re: Regrading thread Error

    i will do all the thing but i am not able to get success ,please tell to me how to get state of thread in j2me.

  14. #14
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Regrading thread Error

    Quote Originally Posted by sis1987 View Post
    i will do all the thing but i am not able to get success ,please tell to me how to get state of thread in j2me.
    Hi,
    First of all I would like to tell you that you are just reading the posts..and you had never write here that what you did do far?

    Please make this clear that what you did can you please list all of the points..
    1.How you control the threads number?
    2.What exactly is the application?....details?
    3.How you are making the thread communication?

    And in last are you still getting the same error ?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. emulator startup failed
    By hony in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-11-11, 06:07
  2. carbide build problem help please
    By berkcekisbas in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-09-26, 19:41

Posting Permissions

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