When a Java program starts up, several system threads are also started ... Is this why all Java c

C

Casey Hawthorne

When a Java program starts up, several system threads are also started
without the programmer necessarily knowing about them.

Is this why all Java classes have extra synchronization overhead
associated with them even if you are not using threads in your own
program?
 
R

Robert Klemme

When a Java program starts up, several system threads are also started
without the programmer necessarily knowing about them.
Right.

Is this why all Java classes have extra synchronization overhead
associated with them even if you are not using threads in your own
program?

I do not know what you are referring to here. There are certainly some
operations that need to be performed in a thread safe manner (i.e.
loading of a class by a class loader). But normal instance and class
methods do not suffer extra synchronization overhead unless you
explicitly state so. (That would be quite inefficient btw.)

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top