3 messages in net.java.dev.jna.usersRe: [jna-users] jna and daemonizing
FromSent OnAttachments
Paul PhillipsDec 30, 2008 8:53 am 
Wayne MeissnerDec 30, 2008 11:38 am 
Paul PhillipsDec 30, 2008 12:15 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] jna and daemonizingActions...
From:Wayne Meissner (wmei@gmail.com)
Date:Dec 30, 2008 11:38:46 am
List:net.java.dev.jna.users

2008/12/31 Paul Phillips <pau@improving.org>:

// the world's shortest core dumping scala program import Libc.INSTANCE._ object Oops extends Application { daemon(0, 0); }

Any C function you call via JNA which calls fork() and then returns back to java in the child process - like daemon does, is also going to cause other problems.

When fork is called, only the calling thread is replicated in the child process - you lose all other threads, including the GC thread (which means you eventually lock up due to no memory, and no GC thread to reclaim it), and you could also deadlock due to locks held by other threads, which no longer exist.

In general: JNA+fork == bad.

Not exactly sure why you're getting a core dump, but its likely to be related.