Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

threads question

Posted on 2011-04-26
4
Medium Priority
?
311 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 1000 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

650 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