[NBLUG/talk] Java v. C++ in Linux

William L. Thomson Jr. support at obsidian-studios.com
Wed May 7 06:50:04 PDT 2003


On Wed, 2003-05-07 at 01:38, Chad Krsek wrote:
> 
> "Kernel threads are known to the scheduler."
> "User level threads, or coroutine threads, are not
> known to the scheduler"
> 
> This and a larger explanation is at
> http://www.cs.ucsd.edu/classes/fa97/cse30/lec15/

Thanks for the link.

> I read it on pg145, section "Java Threads" in the book
> "Operating System Concepts".

I have that book, but never did finish reading it. However we must have
different versions, I have the Fifth Edition, and what you are referring
to is only available in the 6th edition.

> One thread you create, mapped to one process the CPU
> can see and will schedule, versus n threads mapped to
> one process.

Ok, but I still have yet to see a multi-threaded java app running less
processes than threads.

I did read about a multi-threaded app running under one kernel thread.
Is that what you mean?

> Here's further explanantion of how the Java VM handles
> threads.
> 
> "About Linux Threads"
> http://developer.java.sun.com/developer/technicalArticles/Programming/linux/

Thanks

> 
> And an explanantion of the kernel level vs user level.
> 
> "What's the diffence between green threads and native
> threads?"
> http://developer.java.sun.com/developer/qow/archive/97/index.html

This green and native threads I have read before, but for some reason
they were not in my memory banks.

However there is nothing stopping you from creating native threads as
opposed to green threads.

Further more none of the links state that Java can't create kernel level
threads. It seems that is more up to the OS than Java. Please let me
know if I am wrong on that one and if possible provide a link for
further research.

In fact from my research so far it appears that Linux fails to provide
for general-purpose two-leve posix threads.

I could be an assumption, but here are some links.

Follow this thread it's long but good
http://gcc.gnu.org/ml/java/1999-q4/msg00013.html

http://www.cs.rochester.edu/u/murphy/456/2002/notes/14.deadlocks.txt
http://www.naspa.com/PDF/2001/0701%20PDF/T0107006.pdf
http://216.239.33.104/search?q=cache:gdO5enuJj5IC:www.numerik.uni-kiel.de/~hkw/performance/parallel/threads/whatarethreads.html+linux+kernel+vs+user+level+threads&hl=en&ie=UTF-8
http://www.scism.sbu.ac.uk/ccsv/josephmb/CS-L2-OS/oss/week4.html

If that is the case then there is no difference between Java and C++
with respect to threads in Linux.

> I'm just an undergrad with little experience, so I'll
> shut up and go to bed now. Goodnight.

Experience is not all it's cracked up to be. An open mind, and non stop
willingness to learn can be more important. With computers every day
should be a learning experience for the most part. There is more than
one human could ever absorb, so it is a non-stop learning process.

But please do get some sleep, it's important.


-- 
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios, Inc.
3548 Jamestown Ln.
Jacksonville, FL 32223
Phone/Fax  904.260.2445
http://www.obsidian-studios.com




More information about the talk mailing list