1

How should implement multi-thread in single-threaded Operating system using java?

Java supports "Multi-threading".Is there is any way run the multiple threads (Implementing multi threading) using java in a Single-threaded Operating system (That is the operating system does not support for multi-threading).

3
  • Early JVM's used to do this. It was called "green threads" and worked reasonably well, except when it didn't. :-) It had problems with things that resembled files but were actually devices that could block, like named pipes. Commented Nov 25, 2010 at 7:38
  • What single-threaded operating system are you using? Commented Nov 25, 2010 at 7:50
  • Hi, Mike Clark the question my java interview question.So i post here. Commented Nov 25, 2010 at 9:22

3 Answers 3

2

Sure you can do this, but nevertheless they will processed (within the CPU) one after another...

Sign up to request clarification or add additional context in comments.

Comments

2

Only if the Java implementation lets you. Early JVMs had user-space threads, but they moved to OS threads some time ago. If you are on a single-threaded OS, I suppose it's possible the JVM you are using still has user-space threading.

Comments

2

I think it is possible to do what you have metioned.Because the java application is running in the JVM.So the JVM will handle the multi-threading issues for you. But still the operating system is sigle-thread, the efficiency of your appliation will stay the same.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.