• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Threading guidance to avoid potential deadlock...

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Mattias Sands�ter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic