29 ms·
RE Multithreading: just tried this: public class JavaFiddle { public static void main(String[] args) { new Thread(() -> System.out.println("Hello W
by pulse7 3y ago
RE Multithreading: just tried this:
public class JavaFiddle {
public static void main(String[] args) {
new Thread(() -> System.out.println("Hello World from another thread!")).start();
System.out.println("Hello World!");
}
}
on https://javafiddle.leaningtech.com/ https://javafiddle.leaningtech.com/ and it works...
- lxgr 3y agoBeing able to execute Java threads does not imply that they are being mapped to actual OS-level threads (or any other concurrent construct). Back in the days of J2ME, some embedded JVMs emulated threads at the VM level, for example (due to the OS they were running on itself not supporting any threads, which was true for e.g. Palm OS and many non-smartphone OSes). This was called "green threads", as far as I remember.