[NBLUG/talk] Java v. C++ in Linux
Chad Krsek
ckrsek at yahoo.com
Tue May 6 21:15:01 PDT 2003
--- "William L. Thomson Jr."
<support at obsidian-studios.com> wrote:
> On Tue, 2003-05-06 at 23:55, Chad Krsek wrote:
> >
> > Threads may be easier in Java, but as they run
> within
> > a single user process, I think they lose most of
> their
> > benefit.
>
> What do you mean by this. Threads for Java work the
> same as threads for
> C++.
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.
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.
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.
>
> You have your main program/process that controls
> many other sub-process.
>
> If you have a multi-thread C or C++ app running like
> Apache, Bind or
> etc. you will have many threads or process #'s.
>
> Just the same as if you have say Tomcat running, you
> will also have the
> same thing, multiple threads and processes.
>
> I was speaking more of Java synchronization ability.
> You can declare a
> function to be synchronized and when using it in a
> multi-thread app the
> JVM will make sure things happen in order.
>
> Not to mention creation and control of threads are a
> little easier.
>
> Now do all threads run under a single virtual
> machine. Yes. But that
> virtual machine will allow you to create and manage
> threads.
>
> Just as you would in C, C++ or any other language
> with threading
> capabilities.
>
> --
> 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
>
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/mailman/listinfo/talk
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
More information about the talk
mailing list