OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Neil Madde » Thu, 07 Feb 2008 03:38:22



Only 5 seems in any way trivial to me.


Errr... this doesn't seem to back up your point. Surely they aren't
trivial precisely because they have to take so much care to avoid deadlock?

-- Neil
 
 
 

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Darren Ne » Thu, 07 Feb 2008 10:45:13


Having only one lock is pretty trivial. Locking everything you're going
to use for the program, in alphabetical order, at the start of the
program, is pretty trivial.

The Banker's Algorithm isn't *that* hard.


They don't take that much care. Besides, the quote basically said
"non-trivial programs deadlock." I'm pointing out how you can avoid it.
Not necessarily trivially, but with guaranteed assurances.

--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?

 
 
 

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Neil Madde » Fri, 08 Feb 2008 03:26:54


But knowing what resources you need, and what resources every library
routine you call needs, is not trivial in most cases. It requires
knowing the implementation details of every library procedure you call.

-- Neil
 
 
 

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Darren Ne » Fri, 08 Feb 2008 12:15:38


Depends on the level of locking. This works best when the sort of thing
you're locking is "I'll need two tape drives, four dedicated processors,
and 20 minutes on the film burner to render this movie clip. Let me know..."

Or "this query will need to lock the employee's table, the taxes table,
and will need a write lock on the checks-to-print table."

If you're talking about individual objects, like at the
programming-language level, yeah, it's harder.

--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
 
 
 

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Donal K. F » Fri, 08 Feb 2008 18:09:11


This is because deadlock-freedom is a global property, rather like
security or buglessness. With such things, the smallest unit that you
can analyse and get a strong answer on is a whole application, and often
you need to go up to analysing entire systems. Which takes you straight
into the territory of intractability. :-\ The easiest way to deal with
such things is to write highly robust modules that (to as great an
extent as possible) don't lock anything, allowing you to subdivide the
problem and factor out stuff that (you hope) doesn't matter.

But this is a general computing problem, and not Tcl-specific. Tcl's
actually pretty good in this regard. :-)

Donal.
 
 
 

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Andreas Le » Sat, 09 Feb 2008 16:34:26


Until you get struck by a nested vwait that
prevents your outer vwait from finishing...
 
 
 

OT: Deadlock avoidance (Was: Tcl-URL! - weekly Tcl news and links (Feb 4))

Post by Darren Ne » Sun, 10 Feb 2008 05:07:26


Yeah, well, three cheers for continuations! ;-)

Or another one: you have a vwait going, and you kill off all [after]
jobs in an [after] job (as in when you get a signal). Now you bomb out
with a "would wait forever" error.

--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?