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


Groups > comp.lang.c++ > #89081

Re: timed_mutex -- but it acquires the lock

From Paavo Helde <eesnimi@osa.pri.ee>
Newsgroups comp.lang.c++
Subject Re: timed_mutex -- but it acquires the lock
Date 2023-02-10 20:57 +0200
Organization A noiseless patient Spider
Message-ID <ts643e$14dr0$1@dont-email.me> (permalink)
References (5 earlier) <ts2ahr$k6o5$2@dont-email.me> <2df24b6d-dc63-4254-90c6-5fa31218db93n@googlegroups.com> <3e34a03f-f6d2-4aad-8f7a-c3ca20a87b26n@googlegroups.com> <ts3uh2$q5ck$3@dont-email.me> <bd9bcc18-80f4-428d-9564-5d3445974a89n@googlegroups.com>

Show all headers | View raw


10.02.2023 18:06 Frederick Virchanza Gotham kirjutas:
> 
> Okay I'm starting to think that a process might not be salvageable
> after any of its threads is killed or cancelled.
> 
> So instead maybe I could program a mutex watchdog system something
> like as follows:
> (1) Periodically check that all the worker threads are still alive.

I'm not sure why you are fixated on thread deadlocks. Why don't you 
worry about NULL dereferences or other violations which will typically 
kill the process on spot?

> (2) If one of the watchdog timers times out, do the following:
> (2.a) Take a photograph of the GUI window on the screen, i.e. take
>            a screenshot of it and save it as a bitmap. > (2.b) Save the values of all the widgets to a file (e.g. the text in
>            text boxes, whether a tick box was ticked, the position
>            of a slider).

It would be much easier and more robust (and would also work in case of 
crash) to save settings in file or in registry as soon as they are changed.

> (3) Start a new process that does the following:
> (3.a) Displays the aforementioned bitmap on the screen over the real dialog
> (3.b) Kills the main program
> (3.c) Restarts the main program and loads the widget values from the file
> (3.d) Removes the fake bitmap off the screen
> 
> The idea here is that the main program would be killed and restarted
> without so much as a flicker on the screen.

I'm just curious - what is the intended purpose? You don't really expect 
the user is so dumb that they will not notice when your buggy program 
freezes or misbehaves, but yet will somehow notice some flicker on the 
screen?

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-07 01:25 -0800
  Re: timed_mutex -- but it acquires the lock Muttley@dastardlyhq.com - 2023-02-07 09:40 +0000
    Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 12:12 -0800
  Re: timed_mutex -- but it acquires the lock Bo Persson <bo@bo-persson.se> - 2023-02-07 10:48 +0100
    Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-07 05:46 -0800
      Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 12:14 -0800
    Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 12:22 -0800
      Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-07 14:17 -0800
        Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 14:24 -0800
          Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 14:49 -0800
          Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-07 14:51 -0800
            Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 14:53 -0800
              Re: timed_mutex -- but it acquires the lock scott@slp53.sl.home (Scott Lurndal) - 2023-02-07 23:01 +0000
                Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 16:06 -0800
        Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 14:28 -0800
  Re: timed_mutex -- but it acquires the lock Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-07 12:23 +0200
  Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 14:53 -0800
  Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-07 16:08 -0800
    Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-08 10:37 -0800
      Re: timed_mutex -- but it acquires the lock Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-08 20:52 +0200
        Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-08 12:37 -0800
        Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-08 15:14 -0800
          Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-08 17:33 -0800
          Re: timed_mutex -- but it acquires the lock Öö Tiib <ootiib@hot.ee> - 2023-02-08 17:45 -0800
          Re: timed_mutex -- but it acquires the lock David Brown <david.brown@hesbynett.no> - 2023-02-09 09:23 +0100
            Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-09 01:24 -0800
              Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-09 02:02 -0800
                Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 15:10 -0800
                Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-10 08:06 -0800
                Re: timed_mutex -- but it acquires the lock David Brown <david.brown@hesbynett.no> - 2023-02-10 17:30 +0100
                Re: timed_mutex -- but it acquires the lock scott@slp53.sl.home (Scott Lurndal) - 2023-02-10 17:02 +0000
                Re: timed_mutex -- but it acquires the lock Richard Damon <Richard@Damon-Family.org> - 2023-02-10 20:02 -0500
                Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-17 12:58 -0800
                Re: timed_mutex -- but it acquires the lock Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-10 20:57 +0200
          Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 04:02 -0800
            Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-09 04:16 -0800
              Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 04:28 -0800
              Re: timed_mutex -- but it acquires the lock Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-09 14:36 +0200
                Re: timed_mutex -- but it acquires the lock Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2023-02-09 08:34 -0800
                Re: timed_mutex -- but it acquires the lock David Brown <david.brown@hesbynett.no> - 2023-02-09 20:25 +0100
                Re: timed_mutex -- but it acquires the lock scott@slp53.sl.home (Scott Lurndal) - 2023-02-09 19:39 +0000
                Re: timed_mutex -- but it acquires the lock Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-09 23:24 +0200
                Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 14:08 -0800
                Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 15:07 -0800
      Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-08 12:36 -0800
      Re: timed_mutex -- but it acquires the lock Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-09 09:14 +0200
        Re: timed_mutex -- but it acquires the lock "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-09 14:17 -0800

csiph-web