Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 May 2001 08:16:37 -0400
From:      "David P. Caldwell" <inonit@inonit.com>
To:        <freebsd-java@freebsd.org>
Subject:   RE: Reading and writing audio data at the same time on Linux
Message-ID:  <JIEPJODHFFPGJDGMCPBEIENCCDAA.inonit@inonit.com>
In-Reply-To: <51C3A5885AC5D111B68100201861C72750218D@INTERCOPE>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm not an expert on the linux JDK, but I ran into this sort of problem a
few years back.

Could it have to do with different scheduling?

Since the Java VM specification doesn't say much about how threads have to
work, implementors on Windows have tended to use timeslicing (which Windows
has), while implementors on Unix-like OSes have tended to use preemptive
(for different priorities) but non-timeslicing scheduling.

On Unix-like OSes, usually a call to Thread.yield() is required periodically
if you want other threads with equal priority to have a chance to run.
Alternately, you can start a separate Thread at Thread.MAX_PRIORITY that
just wakes up every specified number of milliseconds and does nothing,
causing the scheduler to switch threads.

Or I might be on the wrong track entirely, of course.  Apologies in advance.

-- David.

-----Original Message-----
From: owner-freebsd-java@FreeBSD.ORG
[mailto:owner-freebsd-java@FreeBSD.ORG]On Behalf Of Sudhir Kumar
Sent: Friday, May 04, 2001 7:27 AM
To: 'java-port@FreeBSD.ORG'
Subject: Reading and writing audio data at the same time on Linux



Hi,

I am doing an application (voice based) that require "Source data
line"(audio data can be read) and "Target data line"(data may be written) to
be open at the same time.

I am creating two threads, one for reading, and other for writing and starts
both at same time.

On Windows 2000, both thread runs, but on Linux one thread blocks.

If thread started reading the audio data from "Source data line" then other
will wait for some resource and vice versa.

If i run one thread in my application (any one thread), it works.

If i run each thread in different application, it blocks.

Everything runs perfectly well on Windows 2000.

I am using jdk1.3 on SuSe Linux 7.0 and using javax.sound.sampled package.

Can anyone give me an idea of what to do? I would be glad to explain more.
Thanks in advance for your help.

Sudhir



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?JIEPJODHFFPGJDGMCPBEIENCCDAA.inonit>