Received: from PACIFIC-CARRIER-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA18055; Fri, 12 Jan 96 11:05:22 EST
Received: from liquor.cabi.net by MIT.EDU with SMTP
	id AA21163; Fri, 12 Jan 96 11:05:16 EST
Received: (from listadm@localhost) by liquor.cabi.net (8.6.12/8.6.12) id LAA02473; Fri, 12 Jan 1996 11:04:56 -0500
Resent-Date: Fri, 12 Jan 1996 11:04:56 -0500
Sender: sulrich@wasp.designstein.com
Message-Id: <30F689A9.54ECB67C@designstein.com>
Date: Fri, 12 Jan 1996 10:17:45 -0600
From: Steve Ulrich <sulrich@designstein.com>
Organization: Designstein Inc.
X-Mailer: Mozilla 2.0b5 (X11; I; Linux 1.3.45 i486)
Mime-Version: 1.0
To: java-linux@java.blackdown.org
Subject: Re: Threads and time quantum
References: <Pine.OSF.3.91l.960111215904.25005P-100000@saul6.u.washington.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <"-ht9J2.0.ib.rPezm"@liquor>
Resent-From: java-linux@java.blackdown.org
X-Mailing-List: <java-linux@java.blackdown.org> archive/latest/932
X-Loop: java-linux@java.blackdown.org
Precedence: list
Resent-Sender: java-linux-request@java.blackdown.org

Randy Chapman wrote:
> 
> (does this really belong on java-linux-dev or here?)
> 
> On Thu, 11 Jan 1996, Davide Rossi wrote:
> > Hello,
> > meybe someone who knows more that I do about the thread library used to port
> > java (Randy ?) could reply this question:
> > if I have, say, 3 processes on my host that share fairly the cpu time.
> > If a process runs 3 thread, each process/thread has the same time quantum
> > or threads get 1/3 respect other processes?
> > And what about other operating systems (win95, solaris, ...)?
> > Just curious.
> 
> Ahh yes... very good question, actually =)
> 
> On Linux, as on Solaris (and on the Mac), Java is strictly one process
> using a completely user level threading implementation.  This means,
> then, that if there are three threads in one process, and one each
> in two others, each *process* as a *whole* gets the same amount of
> processer time.  Thusly, the individual threads in one get 1/3 the
> time as the one thread in the other process.
> 
> If the code were to use solaris threads, the many java threads of one
> process would be split across a couple processes and (I assume),
> thusly bringing the priorities of the threads of that process relative to
> another process back up.

I was under the impression that solaris implemented Light Weight Processes, and
that it was to these LWP's that threads are "attatched" to.  Is this what you
mean by processes in solaris?  Or are you referring to "real" processes?

I'm very green in my understanding of Threads.  I would appreciate some
clarification on this point.  

 
> A simplistic linux kernel-based threads approach, otoh, would have each
> thread in what, as far as the time-slicer is concerned, is a separate
> task, thus each thread of the 3threaded app having the same priority
> as a full single-threaded app.  Needless to say, this would allow some
> nasty clone/thread bombs in java, hence why I dont like this idea =(
 
This makes sense and it would seem this approach could cause problems for
more "critical" processes, am I right here?  

> On MS-Windows, the java system uses kernel-based threads (which entain
> just the one task switcher at the krnel level instead of the two).
> I suspect, however, that the task as a whole has no more priority
> than any other task, so each thread is lower than those from single-threaded
> applications.
> 
> On the relevance to programming in java side of the matter....
> Windows threads are preemptive within the same priority level.
> Solaris/Linux threads are not.  Beware.




-- 
Later...

Steve Ulrich
sulrich@designstein.com

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzCzte4AAAEEAMG4PMjyNIBf3hyp/3sCEWKJ/watOVUYuXwXUgepZVKEA0OU
329uUWQ2LmaTsJ7uYsbLJdNdNg9EJ8PtsHKFAHwBH+ifU6Lu3y8vdgQMhDDH2KdP
6qFvp8m4xLiQyZaAF3plYeFlAawHvHXoA9hdx1zswcqYD1hZcF8kQQoS1kY9AAUR
tCZTdGV2ZSBVbHJpY2ggPHN1bHJpY2hAZGVzaWduc3RlaW4uY29tPg==
=4Lfc
-----END PGP PUBLIC KEY BLOCK-----

