Solved

threads question

Posted on 2011-04-26
4
295 Views
Last Modified: 2012-05-11
Threads are lightweight processes that appear to run in parallel with your main program. Unlike a process a thread shares memory and data with the rest of the program. The word thread is a contraction of "thread of execution", you might like to imagine a rope from which you have frayed the end and taken one thread. It is still part of the main rope, but it can be separated from the main and manipulated on its own. Note that a program that runs with multiple threads is different from simply starting multiple instances of the same program, because a Threaded program will have access tot he same data within the program.

I was reading above staemtent. I have not understood the statement, concept behind clearly.
Please advise. Any ideas, sugestions, sample code, links, resources highly appreciated. thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 35469067
I'm sure, you know that threads is Java way to implement simultaneous execution of several
processes. Java has extensive and convenient methods which allow to launch several threads of execution
and manage those threads - stop and resume them, kill them, make interaction and communication
between the threads and allow them to access the same variables.
In some situations it is convenient to have long job - say delaing with files or databases in
one thread in background, and at the same time user could inteeract with application
through another thread.

With all that - it brings additional level of complexity to write programs
taking advantage of threads. So if it does not bring a real benefit in a sense of user interactions
and efficiency you will probably  prefer to stick to normal one-threaded application.

If you ask more specific question, you'll probably get better answers from the folks here.

0
 
LVL 7

Author Comment

by:gudii9
ID: 35471157
>>.you might like to imagine a rope from which you have frayed the end and taken one thread. It is still part of the main rope, but it can be separated from the main and manipulated on its own.

I was not clear on this statement in particular. please advise
0
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 35471420
This is kind of figurative speech which emphasizes that threads in java can interact share
the dats spawn one another and so on...
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
ID: 35471651
A program can be made up of multiple threads (of execution)
Each thread can access the application data independently

http://en.wikipedia.org/wiki/Thread_(computer_science)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SequenceInputStream example 3 33
junit example issue 2 50
batch vs regular insert in spring DAO 2 47
Html split(text) 2 44
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question