Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #4045

Re: Detecting mutexes owned by dead processes

From Steve Watt <steve.removethis@Watt.COM>
Newsgroups comp.programming.threads
Subject Re: Detecting mutexes owned by dead processes
Date 2018-02-06 00:23 +0000
Organization Watt Consultants, San Jose, CA, USA
Message-ID <p5asi1$cfn$1@wattres.Watt.COM> (permalink)
References <57vcfv$s6v@stratus.skypoint.net> <8aa2d575-75b9-4bbd-aa75-4dc9605931d2@googlegroups.com>

Show all headers | View raw


In article <8aa2d575-75b9-4bbd-aa75-4dc9605931d2@googlegroups.com>,
 <gee.akyol@gmail.com> wrote:
[ ... ]
>As I said at the beginning, since write lock is granted only to one thread
>at a time, it is easy to do.  If it is required that "dead" threads be also
>detected when readers are involved, a list of readers have to be maintained.
>
>So make sure you crash only when u have the write lock & not the read lock :-)

And make sure you crash only when you're leaving the data structure in a
state that won't nuke other accessors.  But the owning thread crashed,
so it's a huge gamble about whether the protected data structure is
safe.

Having a shared lock silently succeed when the previous write-locking
owner dies is a terrible idea.  EOWNERDEAD exists to allow code that can
do sanity checks or reconstruction on data structures.

Basically what will happen with your scheme is that some thread will
take the write lock, start manipulating the data structure, and explode
while pointers are still in an inconsistent state.  Then the next (more
innocent) thread will come along, attempt to modify the data structure
in some other way, and also crash.  Lather, rinse, repeat, until all
processes that might update the shared structure have crashed.

Good luck debugging the mess that ensues.
-- 
Steve Watt KD6GGD  PP-ASEL-IA          ICBM: 121W 56' 57.5" / 37N 20' 15.3"
 Internet: steve @ Watt.COM                      Whois: SW32-ARIN
   Free time?  There's no such thing.  It just comes in varying prices...

Back to comp.programming.threads | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Detecting mutexes owned by dead processes gee.akyol@gmail.com - 2018-02-02 13:16 -0800
  Re: Detecting mutexes owned by dead processes Kaz Kylheku <217-679-0842@kylheku.com> - 2018-02-02 23:47 +0000
  Re: Detecting mutexes owned by dead processes Steve Watt <steve.removethis@Watt.COM> - 2018-02-06 00:23 +0000

csiph-web