termination is used in its general meaning, but it is bounded by the programming scope.
Questions tagged [termination]
351 questions
11
votes
2 answers
How do I implement graceful termination in Java?
Say for instance I have my application running in a Linux terminal and I press "CTRL+C" on my keyboard to kill the process it will terminate the Java program.
Is there any way to catch this "request" in my Java application so I can shut it down…

Cheetah
- 13,785
- 31
- 106
- 190
11
votes
1 answer
Coming back on Play Store after Account Termination (100% Secure)
Background:
My Play Store account was terminated because it had more then 3 apps suspended on it but it was in the start of my play store account. I was using account for over month after that and no other game got suspended because as i improved…

Dev
- 135
- 1
- 3
11
votes
2 answers
Destruction order of statically initialized, non-literal objects
A recent question drew my attention to the way that constexpr has changed in C++14. The new feature is that a non-local variable with static storage duration may be initialized in the static initialization phase if its initializer consists of a…

Kerrek SB
- 464,522
- 92
- 875
- 1,084
10
votes
1 answer
Derivatives of data structures in Agda
I am currently implementing derivatives of regular data structures, in Agda,
as presented in the One-Hole Context paper by Conor McBride [5].
In implementing it straight out of the OHC paper, which has also been done by Löh & Magalhães [3,4], we are…

N. Brett
- 171
- 5
10
votes
1 answer
What happens if there is no exit system call in an assembly program?
In an assembly program, the .text section is loaded at 0x08048000; the .data and the .bss section comes after that.
What would happen if I don't put an exit syscall in the .text section? Would it lead to the .data and the .bss section being…

Nishant
- 20,354
- 18
- 69
- 101
9
votes
0 answers
Android Studio terminates app during debug if stopped at a breakpoint for more than several seconds
I have an Oppo A53s running Android 11. When I set a breakpoint in the initial activity (login page), once the breakpoint is hit the app will terminate after five seconds of inactivity. This problem doesn't occur on the emulated devices or on my…

FractalBob
- 3,225
- 4
- 29
- 40
9
votes
3 answers
Nested recursion and `Program Fixpoint` or `Function`
I’d like to define the following function using Program Fixpoint or Function in Coq:
Require Import Coq.Lists.List.
Import ListNotations.
Require Import Coq.Program.Wf.
Require Import Recdef.
Inductive Tree := Node : nat -> list Tree ->…

Joachim Breitner
- 25,395
- 6
- 78
- 139
9
votes
2 answers
How to call a function when Apache terminates a Flask process?
I have a Flask app running behind Apache HTTPD. Apache is configured to have multiple child processes.
The Flask app creates a file on the server with the file's name equal to its process ID.
The code looks something like this:
import…

steve
- 2,488
- 5
- 26
- 39
9
votes
7 answers
detect program termination (C, Windows)
I have a program that has to perform certain tasks before it finishes. The problem is that sometimes the program crashes with an exception (like database cannot be reached, etc).
Now, is there any way to detect an abnormal termination and execute…

wonderer
- 3,487
- 11
- 49
- 59
8
votes
9 answers
Is there anything wrong with using an empty for loop?
It was a little while since I last programmed and I have seem to forgotten if it's acceptable to use an empty "for loop" for creating an infinite loop?
for(;;)
Currently I use this method in a program to make it repeatedly ask the user to enter two…

Anonymous
- 81
- 1
- 3
8
votes
1 answer
Do finalizers (and ReferenceQueue's) run on JVM termination?
I know you can't count on finalizers to clean up your mess (i.e. free resources), but I was wondering - do java objects get GC'ed / finalized when the JVM normally terminates (System.exit() / no threads left)?
EDIT:
So, the GC is not guaranteed to…

Elist
- 5,313
- 3
- 35
- 73
8
votes
4 answers
Stop pyzmq receiver by KeyboardInterrupt
Following this example in the ØMQ docs, I'm trying to create a simple receiver. The example uses infinite loop. Everything works just fine. However, on MS Windows, when I hit CTRL+C to raise KeyboardInterrupt, the loop does not break. It seems that…

Tregoreg
- 18,872
- 15
- 48
- 69
7
votes
2 answers
Makefile failing when using diff on different files
Part of my makefile for my C++ project uses the diff command to compare two files that were output by the recently built code. The issue is that if the files are different, the script should not fail and should continue. There are more files that…

gsgx
- 12,020
- 25
- 98
- 149
7
votes
1 answer
Termination of structural induction
I can't get Agda's termination checker to accept functions defined using structural induction.
I created the following as the, I think, simplest example exhibiting this problem.
The following definition of size is rejected, even though it always…

Cactus
- 27,075
- 9
- 69
- 149
7
votes
0 answers
Does Agda treat records and datatypes differently for the purposes of termination-checking?
Here is an example of some Agda (2.4.2) code defining games and a binary operation on games.
module MWE where
open import Data.Sum
open import Size
data Game (i : Size) : Set₁ where
game : {Move : Set} → {

Twey
- 388
- 2
- 9