Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working of Threads in java

 
swati aole
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

It's just a simple query about the implementation mechanism of java. I want to know how Threads work in java. I mean it's just a class like other classes and implements Runnable but we can define any such class with run and start methods but it won't work like Thread class. Are there any language specifications used to identify it as a special class. If yes, please tell me how they are implemented, via compiler, interpreter or JVM?? which one recognizes and differs special classes.

thanks in advance.

Regards
Swati
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't anything in the Java language which treats the Thread class differently than any other class.

It's certainly true that there is native code in the Java runtime which makes Threads behave the way that they do, but that's true of a lot of other classes. For example java.io.File will have native code which allows the runtime to work with files. There's really nothing special about the Thread class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic