LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2011, 07:54 AM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
How to solve concurrency problems in java


Hi,

I think that I'm facing problem with concurrency in my application. I suspect that I'm facing problems with deadlocking and conditional waits that remain locked forever.

I don't have a clue on how to detect and solve concurrency problems. Any one can advice me what to do?

Thanks,
 
Old 08-10-2011, 08:33 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Can you wrap the mutexes and conditionals in classes that output debugging information (e.g. "locked", "unlocked", etc.)? That might be a useful permanent solution for future debugging, as well. I'm not familiar with threads in Java, but in POSIX C you have access to a unique thread identifier within the thread, which can be output for tracking purposes.
Kevin Barry
 
Old 08-10-2011, 05:01 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You could do worse than getting an IDE like Eclipse (my recommendation) or Netbeans and simply break into the debugger at any one of the threads you're afraid might be deadlocked, and use the debugger to analyze - and resolve - the problem.

This likes a good link for thread debugging under Netbeans:

http://netbeans.org/kb/docs/java/deb...ithreaded.html

'Hope that helps .. PSM
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to solve a java problem maybe yimaizhe Linux - Newbie 1 05-20-2011 08:12 PM
how to solve equation from string in java? rabbit2345 Programming 27 11-04-2008 09:19 AM
how to solve problems with permissions? tuffsach Linux - Newbie 2 10-10-2007 04:50 AM
Java concurrency xeon123 Programming 3 07-09-2007 05:18 AM
Will Mandrake 10 solve my problems? HadesThunder Mandriva 8 05-12-2004 06:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration