Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

Help needed in Threads !!!!!

Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I need Help in Threads.... I am very weak in threads......i am not able to understand the concepts...... theory wise i am a little ok ...but practically i am not able to understand the concepts from the ground up ..... Please help me in understanding threads practically .... please provide me with simple practical examples by which i can learn the basic concepts of threads..... I am not able to find any good example of threads on net .....Thanks in advance .....
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Threads can be a difficult topic to work.

I have come to realize that threads are the machine in operation.

Say if you write:

Thread t = new Thread(object);

it becomes extremely difficult to people to get the idea that the code you have written is not the thread it's self, a Thread has two things to think about:

  • The code you wrote.
  • The machine in execution.

  • You write some code, then the machine will execute the run() method for you - one time - separately from where you started it - then that thread has "run". In so doing, you can accomplish work in "two places at once" as though there were two computers running. Each thread of execution, while running, may be thought of as a computer running. Keeping track of what is where becomes the subject of much discussion, but ofen overlooks the "computational machinery running as a machine" side of the discussion.

    Say you had two calculators in class, or two wristwatches or two soccer game video devices or whatever, side by side, but would only write the code one time.

    What would happen, how would one write the code ?

  • A question from Java Concurrency in Practice
  • Threads and Synchronization -> practical applications of threads/synchronization
  • Failure mode of two reference calls to one thread in which I ultimately went back and admitted I had the question wrong.

  • Don't feel lonely, Read Henry's book - it uses understandable language and gives numerous points that are of great utility in grasping the concept.
    Your mind is under my control .... your will is now mine .... read this tiny ad
    Java file APIs (DOC, XLS, PDF, and many more)
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!