Questions tagged [terminate]

For questions regarding the termination of processes, threads, and sessions.

937 questions
26
votes
4 answers

ruby timeouts and system commands

I have a ruby timeout that calls a system (bash) command like this.. Timeout::timeout(10) { `my_bash_command -c12 -o text.txt` } but I think that even if the ruby thread is interrupted, the actual command keeps running in the background.. is it…
luca
  • 12,311
  • 15
  • 70
  • 103
26
votes
7 answers

How to properly stop a multi-threaded .NET windows service?

I have a windows service written in C# that creates a truck load of threads and makes many network connections (WMI, SNMP, simple TCP, http). When attempting to stop the windows service using the Services MSC snap-in, the call to stop the service…
Mark
  • 5,223
  • 11
  • 51
  • 81
22
votes
1 answer

Python Process won't call atexit

I'm trying to use atexit in a Process, but unfortunately it doesn't seem to work. Here's some example code: import time import atexit import logging import multiprocessing logging.basicConfig(level=logging.DEBUG) class W(multiprocessing.Process): …
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
21
votes
1 answer

What should happen if one calls `std::exit` in a global object's destructor?

Consider the following code: #include struct Foo { ~Foo() { std::exit(0); } } foo; int main() { } It compiles and terminates with zero successfully for me both on my Linux (GCC, Clang) and Windows (Visual Studio). However,…
yeputons
  • 8,478
  • 34
  • 67
21
votes
5 answers

run xterm -e without terminating

I want to run xterm -e file.sh without terminating. In the file, I'm sending commands to the background and when the script is done, they are still not finished. What I'm doing currently is: (cd /myfolder; /xterm -ls -geometry 115x65 -sb -sl 1000)…
jarhead
  • 1,821
  • 4
  • 26
  • 46
19
votes
3 answers

Quit valgrind cleanly when debugging with gdb

I am debugging a program using valgrind and gdb. However I terminate those debugging sessions in a barbaric way… Is it really how it is meant to be done ? Setting up the debugging session Following the instructions from the official valgrind website…
Gael Lorieul
  • 3,006
  • 4
  • 25
  • 50
18
votes
8 answers

C# Process Killing

I need to write a program in c# that would just start, kill one process\exe that it is supposed to kill and end itself. The process I need to kill is another C# application so it is a local user process and I know the path to the exe.
Moon
  • 19,518
  • 56
  • 138
  • 200
17
votes
2 answers

Java program terminating after ObjectMapper.writeValue(System.out, responseData) - Jackson Library

I'm using the Jackson library to create JSON objects, but when I use the mapper.writeValue(System.out, responseData) function, the program terminates. Here is my code: import java.io.IOException; import java.util.HashMap; import…
gsgx
  • 12,020
  • 25
  • 98
  • 149
17
votes
5 answers

How terminate child processes when parent process terminated in C#

Task: Auto kill all child processes if parent process terminate. Parent procees can be terminated not only in correct way, but also by killing in ProcessExplorer, for example. How can I do it? Similar question in С topic advice to use Job objects.…
LionSoft
  • 1,469
  • 2
  • 15
  • 20
16
votes
2 answers

Toggle Opacity with HotKey in Terminal/iTerm

Is there any way to set up a hotkey to change the opacity in either the terminal or iTerm? I usually use a low percentage opacity and it would be nice to be able to toggle on and off quickly. EDIT: Cmd + U does essentially the same thing without…
16
votes
5 answers

Thread does not abort on application closing

I have an application which does some background task (network listening & reading) in a separate Thread. It seems however that the Thread is not being Terminated/Aborted when I close the application (click "x" button on titlebar). Is that because…
migajek
  • 8,524
  • 15
  • 77
  • 116
16
votes
2 answers

R shiny: How to allow users to stop the process? And how to stop the app from backend?

I have a shiny app that allows users to upload their own data and do a few tasks. Depending on their data size and the type of tasks they would want to perform, sometimes the process gets long and even lasting forever. I would like to add the "stop"…
cloudy
  • 183
  • 1
  • 6
14
votes
2 answers

Does Linux guarantee freeing malloc'd unfreed memory on program exit?

I used to believe it does for certain but... I can't find it explicitly stated. man 3 exit and man 2 _exit verbosely specify the effects of process termination, but don't mention memory leaks. Posix comes closer: it mentions this: Memory mappings…
user4385532
14
votes
6 answers

Terminate a thread after an interval if not returned

I have a thread which grabs some data from network or serial port. The thread must terminate (or return false) if no data is received within 5 seconds. In other words, if running the thread is taking more than 5 seconds it must stop. I am writing in…
Mahdi
  • 198
  • 2
  • 2
  • 9
14
votes
2 answers

Why do i get a "terminated due to timeout" error for my code at hackerrank?

I got a "Terminated due to timeout error" when i ran my code for some specific testcases only. Even though my code compiled successfully for other testcases. Can someone please help me with this? Link -…
Swaggerboy
  • 339
  • 1
  • 2
  • 15
1
2
3
62 63