Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Detect deadlocks with TCL

Open612513ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 22 years ago
Descriptionplain2002-09-21 14:45:09
I've read under "http://java.sun.com/j2se/1.4.1/changes.html#vm" about a utility that can detect deadlocks 
with the programming language "Java". (Example listing: 
http://java.sun.com/j2se/1.4.1/sample-output.html)

Can a similar tool be offered for the programming language "TCL"?
elfringplain2002-09-21 22:18:15
Logged In: YES 
user_id=572001

This tool will need some functions in the thread interface to query the dependencies between the running or 
waiting threads.
A helpful function would be to return a list of identifiers for deadlocked threads.
I suggest to offer the function "thread::is_deadlocked id", too.
elfringplain2002-12-28 18:39:52
Logged In: YES 
user_id=572001

The solution will be somewhere in the lock APIs. 
(http://docs.sun.com/db/doc/806-6867/6jfpgdcml?a=view)
vasiljevicplain2002-12-29 01:40:12
Logged In: YES 
user_id=95086

Detecting deadlock may be done be wrapping the mutex API 
i.e. providing your own set of mutex operations. 
This would, however, slow down the application.  
I might put this into the TIP I'm preparing about the  
Tcl threading API. This may be then conditionaly compiled 
for debugging purposes.
elfringplain2002-12-29 04:58:23
Logged In: YES 
user_id=572001

Damned - The pthread interface does not offer any function to query the 
thread and lock usage.
1. I am wondering now why this was not 
introduced into POSIX 1003.1c after this standard was available for so many 
years.
2. I'm curious for your TIP. I hope that the TCL community will find 
an other function library to retrieve the requested information.
elfringplain2002-12-29 06:53:46
Logged In: YES 
user_id=572001

3. Is there anything different with "Java-platform-level deadlocks" compared 
to "Tcl-platform-level deadlocks"?
What are the internal programming 
interfaces?
elfringplain2002-12-29 19:18:02
Logged In: YES 
user_id=572001

4. Another solution:
A detection is not needed if a system was created 
deadlock 
free.
(http://groups.google.com/groups?dq=&start=150&hl=de&lr=&ie=UTF-
8&group=comp.hypercube&selm=302%40hubcap.UUCP)
elfringplain2002-12-30 06:07:11
Logged In: YES 
user_id=572001

I've posted an article about the topic to some newsgroups.
elfringplain2002-12-31 04:27:36
Logged In: YES 
user_id=572001

I add some links to helpful information about algorithms and 
technologies.

4. Can any experiences from "Communicating 
Sequential Processes" (http://www.cs.ukc.ac.uk/projects/ofa/jcsp/csp-
java-model-abstract.html) be applied for TCL?

5. A book 
(http://groups.google.de/groups?selm=12785%40star.cs.vu.nl&rnum=159)
Title: 
    Modern Operating Systems
Author: Andrew S. Tanenbaum
ISBN:   
0-13-588187-0
elfringplain2003-01-16 16:01:58
Logged In: YES 
user_id=572001

http://groups.google.de/groups?
group=comp.programming.threads&selm=40ed1d8f.0301150519.
60fc9f36%40posting.google.com
dkfplain2003-01-21 22:56:41
Logged In: YES 
user_id=79902

Would you guys want me to set up a mailing list for
discussion of thread-related issues?  It'd come with useful
things like archiving tools too...
elfringplain2003-01-22 03:44:48
Logged In: YES 
user_id=572001

Yes. But I would like a newsgroup (interface) 
more...

com.programming.threads.tcl ?
vasiljevicplain2004-06-20 02:48:12
Logged In: YES 
user_id=95086

The deadlock prevention using exclusive mutexes is
now handled in the upcomming 2.6 threading extension.
Instead of deadlock, the Tcl error is thrown.
Also, the deletion of sync promitives in use is also 
terminated with Tcl error.
elfringplain2004-12-15 02:34:20
Logged In: YES 
user_id=572001

Interesting - But the improvement that you describe is just
the expected error handling.

Can a TCL function be added that will be equivalent or
similar to the method "findMonitorDeadlockedThreads" of the
"Threading MBean"?
Would you like to reuse anything from the article "Using
JConsole to Monitor Applications" by Mandy Chung?
http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html#DeadlockDetection
Log in (anonymous is fine) to add a comment.