Thanks, Weiqi. Yes it works. Is it for two threads only?
Regards,
Lee
-----Original Message-----
From: Weiqi Gao [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 04, 2000 12:57 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: JNI & .so Files
[EMAIL PROTECTED] wrote:
>
> [accessing global variables from different threads]
Your so1_beep.c is not thread-safe. And sure enough
it crashes when called from multiple threads.
Making it thread safe means that you have to make the
changes specified in the Multithreaded Programming
Guide.
Linux doesn't seem to have a guide like this.
Balenhof's Pthreads book or the Sun Multithreaded
programming guide (http://docs.sun.com) are good
starting points. But then we are not talking about
Java anymore. Maybe comp.programming.threads is a
more appropriate forum.
I have made jsut enough of the changes to make the
program 'work'. See the attachment.
--
Weiqi Gao
[EMAIL PROTECTED]
=====
Weiqi Gao
[EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]