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

William L. Thomson Jr. support at obsidian-studios.com
Tue May 6 21:47:01 PDT 2003


On Wed, 2003-05-07 at 00:16, Chad Krsek wrote:
>
> That is not necesarily true.  Depending on the thread
> library you use, a c++ can made to run at the kernel
> level.  Therefore it will be scheduled like any other
> process (i.e. the term lightweight process). This is
> the main benefit of multi-threading, in my opinion.

Can you provide an example of this? What is the difference between a
normal C++ thread and a kernel level C++ thread?

Are you speaking of the priority level of the thread?

> There is no specification as to how Java threads are
> to be implemented.  They may map 1 to 1 to a kernel
> level thread, or they may be confined to a single user
> process. If that is the case, that means n threads
> simply split the time allocated to the one user
> process.

In my experience when ever I create a thread in Java I end up with two
or more processes depending on how many threads I am creating.

Same thing goes for every multi-threaded Java app I have worked with?

What do you mean by 1 to 1 mapping?

I have never seen the JVM running say 10 threads but only 5 showing up
as processes in the system.

For every thread I create in Java I have a process to go with that
thread. I have never tried to adjust the priority of the thread, and I
am not sure if you can with Java. I would imagine you could though. 

> I wasn't clear about the variablity of Java threads,
> as dependent on the OS, but I think this unknown makes
> the C++ option better.

I still do not understand what you mean by variability of the threads. I
think I know what you mean but I have not read anything about this, nor
have I seen that to be the case.

Can you provide links?

-- 
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