java 1.1.7/Linux Thread switching
Hi Everyone, I am seeing strange behavior in the way threads are switched in java 1.1.7v3. This is on a RedHat Linux 6.0 system (kernel 2.2.5-22, with glibc 2.1). I have the jdk and native-threads packages for glibc on X86 from blackdown.org. Problem 1: If I start 3 threads at the same priority and none yields or blocks on i/o, only the first one to be started gets time. On a Solaris machine the three threads share time roughly equally. Is this known behavior? Is there a way to choose a different model? I should say that this is using green threads. Problem 2: I tried doing the same thing using native threads, in the hope of getting a better time-sharing model. When compiled and run with native threads, the behavior is strange enough that I think there must be a library mis-match. The main routine usually doesn't sleep for 10 seconds when it is sent a sleep(1l) (it sleeps for more like 100ms, but very occasionally it will sleep for 10 seconds). Can I re-build the native threads part from sources? Or is there a known library problem with glibc2.1? thanks in advance, Rich [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: java 1.1.7/Linux Thread switching
My thanks to everyone for the replies about thread interleaving. The other thing I'm still trying to sort out is this issue with native threads in jdk 1.1.7v3 and redhat 6.0 (with glibc 2.1). There seems to be a library mismatch or something. A simple threaded program runs fine with native threads on a system with glibc 2.0.7 but doesn't work reasonable at all with glibc 2.1.1. Are there any known conflicts, and if so are there any known work-arounds? Of course, it might be something other than glibc that's conflicting... the symptom I see is that a Thread.sleep(1l) returns much, much sooner than it should with no error thrown. I can supply a program to demonstrate the problem if anyone wants. thanks again, Rich [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
jdk118/glibc compatibility
Hi Everyone, I noticed someone posting earlier about having the Blackdown jdk1.1.8 (which looks, from the filename, like it requires glibc-2.1.2) on a RedHat 6.0 system (which has glibc2.1.1). I know the blackdown web-site say glibc2.1.3 is required for the native threads package, but what about green threads? Would I need 2.1.2, 2.1.3, or is any 2.1.x okay? thanks in advance, Rich Ibbotson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Nathan's Book
I realize that this is way off-topic for this list, and I apologize for that... But there's a rather nice web-site put together by Steve Wells and Brian Gannon that compares prices of books at a number of on-line sites: http://www.snmputils.com/booksearch/ It's amazing how the prices vary. For example, a search for Nathan Meyers' "Java Programming for Linux" (ISBN 1571691669) turns up: SITE PRICE VCSS $29.99 KingBooks$31.99 Borders $34.99 BookStreet $35.99 BooksaMillion$39.99 BookBuyer$42.49 Amazon $42.49 Powells $49.99 Softpro $49.99 And no, I'm not affiliated with any of these stores or the authors of the above site/PERL-script. I just use it a lot. Rich Ibbotson [EMAIL PROTECTED] Weiqi Gao wrote: > > Hi, > > I saw Nathan Meyers' new 'Java Programming for Linux' at Borders. > Browsed through it and found it packed with information that a > Java-Linux developer would want/need/find indespensable. Not a > textbook/tutorial. Lots of hints, tools, de-hype-ifications, whys, and > coverage. The spirit of Linux shines through throughout. > > I'm buying it from Amazon.com, they are giving a $7.50 discount on this > book. > > Thank Nathan you for such a wonderful book. And have fun updating it > every year for the next five years. You are going to update it, aren't > you? > > -- > Weiqi Gao > [EMAIL PROTECTED] > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Nathan's Book
I guess they are having trouble catching up, as suggested. Borders has it listed twice: once as $39.99 (status = "Not yet published") and once as $34.99 ($15 off the cover price, ships in 24 hours). But they don't list an author on either version! The "low bidder" (vcss.com) has altered their price from $29.99 to $37.99 since this morning. Jacob Nikom wrote: > > For example, Quantum Bookstore in Cambridge cited $39.99, but called > it "preliminary" price. > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: passing argments between java and c
Boris,
This is not really the right list for this question, since it isn't
specifically about java on Linux. You might be better off sending questions
like this to a more general java list. But you want to look at using the
"GetLongArrayElements" and "ReleaseArrayElements" functions in your C code. I
think it goes something like this:
JNIEXPORT void JNICALL Java_call_aug(JNIEnv *env, jopject obj, jlongArray a)
{
long* array_in_c = (*env)->GetLongArrayElements(env, a, 4); /* assuming length
of 4 */
/* Do whatever you want to array_in_c */
(*env)->ReleaseArrayElements(env, a, 0);
}
cheers,
Rich
Boris wrote:
>
> hello,
> I meet a question in passing argments between java and c.
> In my java program,I call a method in a .dll file and pass a array to it.
> In the .h file that generated by javah,function declaration is followling:
> JNIEXPORT void JNICALL Java_call_aug
> (JNIEnv *, jobject, jlongArray);
>
> I write the following in my c file:
> JNIEXPORT void JNICALL Java_call_aug
> (JNIEnv *env, jobject obj, jlongArray a)
> {
> a[0]=1;
> }
>
> when I build it by vc++,vc++ show the fllowing:
> D:\Boris\args\argdll\arg.cpp(26) : error C2679: binary '=' : no operator defined
>which
> takes a right-hand operand of type 'const int' (or there is no acceptable conversion)
>
> error line is a[0]=1;
>
> How can I pass array ?Or,if I want pass data and want them changed in c ,then
> return,how can i do?
> Thanks
> Boris :-)
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
