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 3 of 3

Thread: how to differ two thread of same process in java

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

    Default how to differ two thread of same process in java

    Hi
    How to diffrer two thread of same process. for example we have two notepad opened in windows
    both are saved with diffrent name. I want to close one by java code then how can i chose correct one by java program. if i kill notepad process then both will be closed. I want to close one at a time.

    Thanks
    Yogs


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: how to differ two thread of same process in java

    How do you start the processes in Java?

  3. #3
    Member
    Join Date
    Jun 2011
    Posts
    56
    Thanks
    2
    Thanked 7 Times in 6 Posts

    Default Re: how to differ two thread of same process in java

    Quote Originally Posted by yog2mis View Post
    Hi
    How to diffrer two thread of same process. for example we have two notepad opened in windows
    both are saved with diffrent name. I want to close one by java code then how can i chose correct one by java program. if i kill notepad process then both will be closed. I want to close one at a time.

    Thanks
    Yogs
    You differentiate threads by their unique thread Identifier (getID() of Thread class). But notepads are opened with processes so you
    would need a process ID. (I am sure there is one in Java)

Similar Threads

  1. java thread programing.
    By parisa in forum Member Introductions
    Replies: 1
    Last Post: July 26th, 2011, 01:38 PM
  2. Java Child process cannot execute properly for telnet command
    By mamunbu in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 25th, 2011, 07:43 AM
  3. The Java 7 Thread
    By KevinWorkman in forum The Cafe
    Replies: 4
    Last Post: July 8th, 2011, 11:56 AM
  4. Help with non-blocking thread that runs an external process
    By rkad40 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 9th, 2011, 04:27 PM
  5. Run Or Cancel Java Thread !
    By byrodi in forum The Cafe
    Replies: 11
    Last Post: November 3rd, 2010, 09:04 AM

Tags for this Thread