Changes

Jump to: navigation, search

GPU621/Go Kimchi

304 bytes added, 05:32, 3 August 2021
Parallel Programming in GO & Java
Java language can implement thread in two different methods. The first method is to create a class which extends the “Thread” class that gives the user to have control of the lifecycle of the thread. But Java language only allows single inheritance which prevents the thread from being extend other base class. The second method is using ‘Runnable’ interface. This method allows to user to extend other base class while still being run as a new thread. However, this method does not give user to control lifecycle of thread.
 
Java version 5.0 and later provides concurrency to simplify thread creation and processing. The "[https://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html Executor]" that implement by java.util.concurrent provides APIs for creating and processing new threads using reusable threads.
58
edits

Navigation menu