www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/11/07/00:23:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 7 Nov 2004 00:23:44 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: JNI call crashes the JVM
Message-ID: <20041107052344.GB11307@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20041107045937 DOT 39823 DOT qmail AT web90003 DOT mail DOT scd DOT yahoo DOT com>
Mime-Version: 1.0
In-Reply-To: <20041107045937.39823.qmail@web90003.mail.scd.yahoo.com>
User-Agent: Mutt/1.4.1i

On Sat, Nov 06, 2004 at 08:59:37PM -0800, Solly Ezekiel wrote:
>I've searched the archives for an answer to this question without
>success, so maybe this is a new problem after all...
>
>What I'm trying to do: Call gettimeofday() from Java via JNI.
>
>Why I'm doing this: System.currentTimeMillis() isn't accurate enough.
>It appears to have an accuracy of only about 10 ms under XP.  I want 1
>ms accuracy or better, and unfortunately, the various "real-time"
>extensions to Java (like javax.realtime) rely on
>System.currentTimeMills().
>
>What I've tried: I wrote a native Java method, wrote a C++ body that
>calls gettimeofday(), compiled and linked as described at
>http://www.inonit.com/cygwin/jni/helloWorld/, loaded the DLL using
>System.loadLibrary(), and made the call from Java.  I'm using Cygwin
>v1.5.11-1, g++ v3.3.3-3 and Mingw32 v20040810-1.

Quoting from this web page:

"The goal of this walkthrough will be to create a native method which
does not rely on the Cygwin DLL.  (In other words, it will depend only
on the Windows API.)"

It's odd, given that statement that you would be sending email to
the Cygwin mailing list.

>So, that's where I am.  I could delve into the innards of Cygwin to
>figure out what is (or isn't) happening, but I don't really have the
>time to do that.  Has anyone tried to do what I'm doing, and do you
>have any wisdom you can share?  I can't be the first person to have
>tried making calls to the Cygwin DLLs from JNI...  can I?

I know nothing about JNI but, if you are trying to load the cygwin
library dynamically, that won't work.  You can't load the DLL in
this way.  Sorry.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019