Using Thread Application
Using Thread Application
Computer Science
Del Institute of Technology
Laguboti, 22381 Indonesia
If413007@students.del.ac.id
Computer Science
Del Institute of Technology
Laguboti, 22381 Indonesia
If413030@students.del.ac.id
Eplianto Butar-butar
Marthin Pasaribu
Computer Science
Del Institute of Technology
Laguboti, 22381 Indonesia
If413034@students.del.ac.id
Computer Science
Del Institute of Technology
Laguboti, 22381 Indonesia
If413073@students.del.ac.id
I. INTRODUCTION
Over the last few years, Java has emerged as an interesting
language for the network programming community. This has
largely occurred as a direct consequence of the design of the
Java language. This design includes, among others, important
aspects such as portability and architecture neutrality of Java
code, and its multithreading facilities. The latter is achieved
through built-in support for threads in the language definition.
The Java library provides the Thread class definition, and Java
runtimes provide support for thread and monitor primitives.
These characteristics, besides others like its familiarity (due to
its resemblance with C/C++), its robustness, security and
LITERATURE REVIEW
A. What is Thread?
Conceptually, the notion of a thread is not difficult to
grasp: it is an independent path of execution through program
code [2]. When multiple threads execute, one thread's path
through the same code usually differs from the others. For
example, suppose one thread executes the byte code
equivalent of an if-else statement's ifpart, while another thread
executes the byte code equivalent of the else part. How does
the JVM keep track of each thread's execution? The JVM
gives each thread its own method-call stack [4]. In addition to
tracking the current byte code instruction, the method-call
stack tracks local variables, parameters the JVM passes to a
method, and the method's return value. When multiple threads
execute byte-code instruction sequences in the same program,
that action is known as multithreading [2]. Multithreading
benefits a program in various ways [2]:
Java
accomplishes
multithreading
through
its java.lang.Thread class. Each Thread object describes a
single thread of execution. That execution occurs in Thread's
run() method. Because the default run() method does nothing,
you must subclass Thread and override run() to accomplish
useful work [3].
B. Thread Scheduling and the JVM
Most (if not all) JVM implementations use the underlying
platform's threading capabilities. Because those capabilities
are platform-specific, the order of your multithreaded
programs' output might differ from the order of someone else's
output. That difference results from scheduling.
When you type java Thread Demo to run the application,
the JVM creates a starting thread of execution, which executes
the main() method. By executing mt.start ();, the starting
thread tells the JVM to create a second thread of execution
that executes the byte code instructions comprising the My
Thread object's run() method [3]. When the start() method
returns, the starting thread executes its for loop to print a table
III. METODS
A. Technique of Collecting Data
There are several things that need to be prepared before
the process of data collection, which collects data about the
thread, and the thread usage in software development. After
that, the data collected through the information in reference
books, and as well as internet sites.
B. Technique of Analyzing Data
Survey software that uses thread theoretically produce
information about any software that uses the thread and the
thread functions in software. To make a comparison of
software that uses that do not use the thread and thread, then
do an analysis of the survey results, especially in the thread
function in the software. The results of this analysis are very
influential on conclusion of this study, and need to pay
attention to the difference between the software that uses
thread and that does not use threads.
IV.
REFERENCES
[1]
[2]
[3]
[4]
[5]
[6]