hi
Every one how to resolve TOOManyThreadError Exception through j2me coding
hi
Every one how to resolve TOOManyThreadError Exception through j2me coding
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.
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,
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,
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..
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.
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.
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
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,
yes i am 100% sure and this is my project requirement.
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,
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,