Questions tagged [detach]

279 questions
196
votes
18 answers

What is the proper way to re-attach detached objects in Hibernate?

I have a situation in which I need to re-attach detached objects to a hibernate session, although an object of the same identity MAY already exist in the session, which will cause errors. Right now, I can do one of two…
Stefan Kendall
  • 61,898
  • 63
  • 233
  • 391
61
votes
2 answers

Detached vs. Joinable POSIX threads

I've been using the pthread library for creating & joining threads in C. When should I create a thread as detached, right from the outset? Does it offer any performance advantage vs. a joinable thread? Is it legal to not do a pthread_join() on a…
user191776
50
votes
2 answers

Disable warning about detached HEAD

In git if you checkout a commit directly you get a big fat warning starting with: "You are in 'detached HEAD' state. You can look around ..." It's fine - I intend to be in detached HEAD state. However I am using this in a script and I don't want…
Zitrax
  • 16,107
  • 15
  • 79
  • 98
36
votes
3 answers

What is different between join() and detach() for multi threading in C++?

What is different between join() and detach() in multi threading in C++? Does join() kill the thread?
r.hg
  • 365
  • 1
  • 3
  • 5
17
votes
11 answers

Google Web Toolkit (GWT) + Google App Engine (GAE) + Detached Data Persistence

I would like to develop a web-app requiring data persistence using GWT and GAE. As I understand it, my only (or at least by far the most convenient) option for data persistence is GAE's Datastore, using JDO or JPA annotated objects. I would also…
Ryan
16
votes
8 answers

What is the easiest way to "detach/daemonize" a Bash script?

What I am trying to do is write a Bash script that sleeps for a set amount of time before using the mac say command to speak some text. I'd like to be able to run the command and then close the terminal so it will still speak at the set time. I've…
Warpling
  • 1,747
  • 2
  • 19
  • 32
15
votes
1 answer

ipython notebook kernel dies ("WebSocket ping timeout") when the SSH connection becomes idle

I was trying to use tmux to start a remote ipython notebook on my Debian server. I then start browser on the Mac OS X local machine. After starting a long-run task, I detach the tmux session and exit the SSH connection. However, after a while I came…
Francis
  • 4,678
  • 5
  • 19
  • 30
12
votes
4 answers

How to find list of attached data-sets in R?

Is there any method in R to find out what data-sets have been attached. In my work flow i use the console and build a script. I try out the lines of code in console and once i am satisfied with the results, i add them to a script so that I can…
Sam
  • 6,812
  • 15
  • 40
  • 59
11
votes
2 answers

node.js: How to spawn detached child in foreground and exit

According to the docs for child_process.spawn I would expect to be able to run a child process in the foreground and allow the node process itself to exit like so: handoff-exec.js: 'use strict'; var spawn = require('child_process').spawn; // this…
coolaj86
  • 64,368
  • 14
  • 90
  • 108
10
votes
3 answers

FragmentTransaction .attach and .detach for Actionbar tabs

I'm trying to get the code here to work. It compiles fine. It will run. And it will load tab 1 (of 3). However, when I click on the 2nd or 3rd tab, I get this: java.lang.NoSuchMethodError: android.app.FragmentTransaction.detach this happens in…
Metallicraft
  • 2,201
  • 5
  • 30
  • 50
10
votes
1 answer

When is it safe to call pthread_attr_destroy?

I am using pthreads on Linux. From the documentation, it is not clear to me when it is safe to call pthread_attr_destroy on the attributes I use to create a new thread? Can I do it immediately after pthread_create returns or do I have to wait until…
Christoph
  • 1,847
  • 2
  • 26
  • 41
10
votes
3 answers

Attach to 'screen' session with creating a new screen window

I have a screen session running with several windows. I want to attach to it, create a new screen window within it and start a shell in that new window. Question: How can I do this from the command line outside the screen session? I already tried…
Alfe
  • 47,603
  • 17
  • 84
  • 139
9
votes
2 answers

Detach a subprocess started using python multiprocessing module

I would like to create a process using the mutliprocessing module in python but ensure it continues running after the process that created the subprocess exits. I can get the required functionality using the subprocess module and Popen, but I want…
glenn
  • 131
  • 1
  • 4
8
votes
4 answers

is it safe to detach a thread and then let it go out of scope (and have it still running)?

I have the following code, which I think works ok (forgive the silly/contrived example). void run_thread() { std::thread t([]{ while(true) { // keep getting chars... to stop peoples eye's hurting : ) char…
code_fodder
  • 12,697
  • 10
  • 68
  • 123
8
votes
2 answers

std::thread::detach causes crash after original caller is destroyed

struct Test { bool active{true}; void threadedUpdate() { std::this_thread::sleep_for(std::chrono::milliseconds(1)); if(!active) // crashes here after Test instance is destroyed return; } Test() { …
Vittorio Romeo
  • 82,972
  • 25
  • 221
  • 369
1
2 3
18 19