Questions tagged [detach]

303 questions
212
votes
17 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
  • 66,414
  • 68
  • 253
  • 406
89
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
  • 19,036
  • 20
  • 88
  • 110
65
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
53
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
  • 535
  • 1
  • 5
  • 5
18
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
  • 2,024
  • 2
  • 22
  • 38
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
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
  • 6,416
  • 5
  • 24
  • 32
14
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
  • 7,922
  • 16
  • 47
  • 62
13
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
  • 56,346
  • 20
  • 107
  • 159
12
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
  • 15,263
  • 17
  • 90
  • 167
12
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
  • 74,004
  • 20
  • 105
  • 125
12
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,964
  • 2
  • 27
  • 44
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,211
  • 5
  • 31
  • 52
10
votes
1 answer

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
  • 149
  • 1
  • 5
8
votes
1 answer

Storing a complex detached object graph in EF6

I have the current scenario: I'm using EF6 Code first, and have created a data-model something like this: public class MainObject{ ..some properties IList SubObjects{get;set;} } public class SubObject{ ..some properties …
Øyvind Bråthen
  • 59,338
  • 27
  • 124
  • 151
1
2 3
20 21