• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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 ]
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic