Forums Register Login

Threading guidance to avoid potential deadlock...

+Pie Number of slices to send: Send
I get the warning "Warning: To avoid potential deadlock, operations that may block, such as networking, should be performed in a different thread than the commandAction() handler."

It starts when I start to access the file system, more specific when I try to list the roots with listRoot(). I know this would be fixed with threading but I am not so good at it. I did do some tries but without success.

Should I move all my filesystem methods into some threaded class or just parts of it? Please guide me into the right direction.
+Pie Number of slices to send: Send
hi friend
call your function inside this block of code in the listener
new Thread(new Runnable(){
public void run()
{
try{
//your function call
}catch(Exception e){}
}
}).start();

hope this helps
Pradeep
+Pie Number of slices to send: Send
Thanks for trying help me.

Do you mean that when I arrive to a filesystem sensetive method call like listRoots() I just do like this:



I tried this, but it couldn�t reach the e-variable from inside the inner class.
[ May 05, 2006: Message edited by: Mattias Sands�ter ]
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6443 times.
Similar Threads
problem with HTTP connection in J2ME
network midlet problem
Problems with Java Wireless Toolkit
Problem in Connecting Application on J2ME WT Emulator with Servlet on Tomcat
j2me/ksoap error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:25:09.