Solved

threads question

Posted on 2011-04-26
4
299 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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

688 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