13 messages in net.java.dev.jna.usersRe: [jna-users] Threading in JNA....
FromSent OnAttachments
Drayton BrownApr 6, 2009 3:40 am 
Timothy WallApr 6, 2009 5:24 am 
Drayton BrownApr 6, 2009 5:34 am 
Drayton BrownApr 6, 2009 9:28 am 
Timothy WallApr 6, 2009 9:50 am 
Drayton BrownApr 7, 2009 2:32 am 
Drayton BrownApr 9, 2009 3:20 am 
Timothy WallApr 13, 2009 6:11 am 
Drayton BrownApr 24, 2009 7:22 am 
Timothy WallApr 24, 2009 9:49 am 
Drayton BrownApr 28, 2009 5:42 am 
Timothy WallApr 28, 2009 6:44 am 
Drayton BrownApr 28, 2009 6:46 am 
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] Threading in JNA....Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Apr 6, 2009 5:24:25 am
List:net.java.dev.jna.users

On Apr 6, 2009, at 6:41 AM, Drayton Brown wrote:

Hi all

I've written a threaded application which uses a thread safe shared object, however when I run the application with more that one thread, the jvm crashes out.

Is the "thread safe object" a Java object or a native one? What makes it thread safe?

I've checked the JNA site for information on how the JNA wrapper handles threading, but I've been unable to find any information. I was hoping someone on the mailing list could give me more information on the topic, or at least point me in the direction of the documentation on it.

JNA itself doesn't do anything special w/r/t threading. There is a Native.synchronizedLibrary() call that may be used to ensure any calls to your native library are serialized (i.e. no more than one call is ever active at any given time).

Return error codes are saved on a per-thread basis.