Results 1 to 3 of 3
  1. #1
    ferosh is offline Member
    Join Date
    Mar 2007
    Posts
    11
    Rep Power
    0

    Default Server n threads

    I have seen a couple of sample applications in which server components are written inside the run method of a thread class.
    What is the purpose of this ? Does this show that the application has multiple servers ?

  2. #2
    ferosh is offline Member
    Join Date
    Mar 2007
    Posts
    11
    Rep Power
    0

    Default

    I expect you to paste the code here :)

  3. #3
    ali
    ali is offline Member
    Join Date
    Apr 2007
    Posts
    7
    Rep Power
    0

    Default

    I am in a bit of a hurry at the moment so I will leave the code for later, right now I will just answer the main question.

    If I understand the question correctly, you want to know why some of the components in the server are sometimes placed in the run method of the thread class.

    The components of the server are written in the run method of the thread class so that when many different clients are connected to the server, the server can cater for each one of them by creating a separate thread for that particular client which ensures that even if multiple clients are requesting the same services, they can be served.

    Hope this helps, will send the code example along with explanation later

Similar Threads

  1. How to use Java threads
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 07:30 PM
  2. Using threads
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-11-2007, 11:25 AM
  3. Threads
    By one198 in forum Threads and Synchronization
    Replies: 1
    Last Post: 11-20-2007, 07:15 PM
  4. Using threads as a countdowntimer
    By lacoste in forum Threads and Synchronization
    Replies: 4
    Last Post: 07-20-2007, 02:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •