java and pthreads

J

Jim

I have the following:
1. a shared lib that uses pthreads heavily.
2. A Java test application that is threading using Java threading, e.g:
( new Thread(new Runnable() { public void run() { ......}
3. A JNI Java wrapper class (a Java routine and a C routine).

So the test app starts 2 threads and calls the Java wrapper class to make
calls inside the .so shared lib.
The .so lib is in the middle of a pthread_cond_timedwait and gets a signal
4 - I am guessing from the JVM.
It doesn't happen the first time it calls the timedwait, but happens fairly
quickly.
With a single thread, the pthread_cond_timedwait will never get executed.

With my C test app, also multi-threaded, the shared lib and the app run
flawlessly for millions of iterations, many "simultaneous" threads.

Anyone have any suggestions on this? Plz?

thanks for any help.

Jim.

I have Linux 2.4.21-15.0.3.EL #1 and java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b04)
Java HotSpot(TM) Client VM (build 1.4.2_04-b04, mixed mode).

The following is the Java dump info: there is also a core, but I am not
able to look at it.

# Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b04 mixed mode)
#
# Error ID: 43113F32554E54494D45110E4350500308
#
# Problematic Thread: prio=1 tid=0x0810a838 nid=0x267c runnable
#

Heap at VM Abort:
Heap
def new generation total 70848K, used 10171K [0x706b0000, 0x75390000,
0x75390000)
eden space 62976K, 16% used [0x706b0000, 0x7109ee38, 0x74430000)
from space 7872K, 0% used [0x74430000, 0x74430000, 0x74be0000)
to space 7872K, 0% used [0x74be0000, 0x74be0000, 0x75390000)
tenured generation total 945280K, used 0K [0x75390000, 0xaeeb0000,
0xaeeb0000)
the space 945280K, 0% used [0x75390000, 0x75390000, 0x75390200,
0xaeeb0000) compacting perm gen total 4096K, used 1016K [0xaeeb0000,
0xaf2b0000, 0xb2eb0000)
the space 4096K, 24% used [0xaeeb0000, 0xaefae048, 0xaefae200,
0xaf2b0000)
Abort (core dumped)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top