Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: java thread programing.

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java thread programing.

    how to stop thread running at middle of function?
    I want to run two functions in parallel,both functions are recursive and they use common variables, so in each iteration they need other function variable to run, How can I stop one thread at the middle of running and switch to other function until the needed variable gets corresponding variable and again switch to first function and run the function from stopping point?


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: java thread programing.

    Are you looking for the wait() and notify() functions? Did you read the concurrency tutorial?

    Lesson: Concurrency (The Java™ Tutorials > Essential Classes)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. need help with Doubly-Linked list programing in java
    By bulutbey in forum Algorithms & Recursion
    Replies: 3
    Last Post: August 22nd, 2011, 01:51 PM
  2. The Java 7 Thread
    By KevinWorkman in forum The Cafe
    Replies: 4
    Last Post: July 8th, 2011, 11:56 AM
  3. help with a programing assignment.
    By oscar_m in forum Object Oriented Programming
    Replies: 4
    Last Post: May 1st, 2011, 02:00 PM
  4. Run Or Cancel Java Thread !
    By byrodi in forum The Cafe
    Replies: 11
    Last Post: November 3rd, 2010, 09:04 AM
  5. Java Thread error plz help me
    By ani1125ster in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 12th, 2010, 10:07 AM