Introduction to Multthreading Client Server

Author: Ronald S. Holland
at
Total Application Works




To contact us



HOME Consulting Design Maintenance Project Testing Training Turnkey Java C++ SQL HTML JavaScript

© 2002 - 2016 All Rights Reserved Total Application Works


    Source Screenshot
    Tell a friend about this site (copy and paste the following HTML page into a file (e.g., using Notepad).)
    <html>
    <head>
    <title>MultiThreaded Client Server </title>
    </head>
    <body>
    <a href="http://sumtotalz.com/TotalAppsWorks/Multithreaded /MT_C_S_Tutorial.html">
    Table Tags </a>
    </table>
    </body>
    </html>


Table of Contents

  • If you are having a problem viewing your DVD/CD ROM using Vista, try Restoring DVD/CD ROM
  • Introduction
  • Why are multithreaded programs of any interest?
  • Requirements
  • What is the purpose of the setup() method?
  • Putting it all together
  • ServerRun() and run() Method modifications
  • Summary of tcpServer Methods
  • Outline of tcpClient Methods
  • Summary of tcpClient Methods
  • Definitions

    Introduction

    The purpose of the tutorial is to show you how to build a multithreaded client server application. This tutorial assumes that you have read and completed the following tutorials.

    1. Applet Life Cycle Tutorial
    2. Thread Life Cycle Tutorial
    3. MultiThreaded Program

    In the Thread Life Cycle Tutorial, we introduced the concept of the many waiter scenario. This implied a multithreaded server. In the MultiThreaded Program Tutorial we built a multithreaded program. How do we go from a multithreaded program to a multithreaded server? One way is merge what we learned in the following two tutorials.

    1. Tutorial: Basic Client/Server Application
    2. MultiThreaded Program
    This means that we will convert the Basic Client/Server Application to a Multithreaded Basic Client/Server Application. We will not repeat the material covered in the previous tutorials A and B above. In this tutorial, we will show you how to migrate from a client/server application to a multithreaded client/server application. We will not modify the Client in any way. All of our work in this tutorial will be in the Server.

    Why are multithreaded programs of any interest? In today's world of the Internet, we have the frequently occurring problem of many requesters/clients and one responder/server. Do you remember the Victoria Secrets site crashing a few years ago? The problem, I theorize, was more requesters/clients than the responder/server could handle in the required timeframe. What? The site developed a bottleneck. Consider a restaurant with one waiter and many patrons/clients. Now consider the same restaurant with many waiters and many patrons/clients. The many waiters scenario can handle the many patrons/clients more efficiently. For our purposes, how do we handle requests? We could develop a FIFO Queue (First In First Out) and pop the queue in a loop, or we could make our responder/server multithreaded. The latter solution would be analogous to the many waiters scenario. When the operating system loads a program into memory for execution, the running program is considered a process. If we have many simultaneous requests for this running program/process, we have the one waiter, many patrons/clients scenario. If we make our process/program multithreaded, we change the scenario to many waiters, many patrons/clients scenario. A running multithreaded process might be shown as:

    Multithreaded Program
      
    Process -------------------------------->
     Thread1 ----- Task ------->
          Thread2 ----- Task ------->
              Thread3 ----- Task ------->
              ...
       Threadn ----- Task ------->
    
      
    Figure 1: A Multithreaded program accomplishing its tasks


    With the Internet, many programs are now written as applets. You may ask, "So, what is your point?" The beauty of the Internet and applets is that when you log on to the Internet and a page is loaded onto your computer, you have started a client server process with your computer and another computer. You have connected and are communicating with another computer. You are multiprocessing in a client-server environment. As you start to investigate the possibilities of client server applications, you will uncover many ways to apply this type of programming. For most of us, the first exposure to this type of programming is the Net Browsers. For example, once you make your server an application server, you open up unlimited programming possibilities and exciting programming challenges. In later tutorials, we will explore the use of servlets and the use of the applet tag in HTML pages.

    Requirements

    The requirements for this project are to:

    1. Use the application we developed in the tutorial, "Basic Client/Server Application' as the basis for our multithreaded client/server application.
    2. The server's GUI will remain the same. The GUI will have the following:
      1. ContentPane
      2. JButton
      3. JPanel
      4. BorderLayout Manager
      5. ActionListener
      6. JTextArea
      7. JScrollPane
    3. Use a setup() method for initialization. Realize that since the GUI is not changing in this example, the work in the setup() method is already done. We will use this method to reinforce the theory behind the Holland's OOP Programming Design Model.
    4. Use Holland's OOP Programming Design Model to do the modification on the tcpServer class.
    5. The Basic Client/Server Application client-server structure that we are working from looks like:

        
      
                                     Java  
                                     API
                                   +------+
                                   |TCP/IP| 
                                   +---+--+
                                       |
        tcpClient               +---+  |  +---+        tcpServer
        Methods                 | S |  |  | S |        Methods
       +-------------------+    | o |  |  | o |    +-------------------+
       | tcpClient()       |<-->| c |  |  | c |<-->| tcpServer()       |
       +-------------------+    | k |  v  | k |    +-------------------+
       | setUp()           |    | e |<--->| e |    | setup()           |
       +-------------------+    | t |     | t |    +-------------------+
       | connect()         |    +---+     +---+    | run()             |
       +-------------------+                       +-------------------+ 
       | run()             |                       | closeConnection() | 
       +-------------------+                       +-------------------+ 
       | closeConnection() |                       | main()            | 
       +-------------------+                       +-------------------+
       | main()            |                            
       +-------------------+
      
        
      Figure 2: Basic Two-Tier Client/Server Application Structure


    6. Add an inner MyThread class to the tcpServer class.
    7. Use the Basic Server Application Template for the tcpServer class.
    We will describe the template we will use to begin converting our applet/application in the next section. Why do we use the setup() method? We will discuss this in the next section.

    What is the purpose of the setup() method?

    The purpose of the setup() method is for initialization. In this application, its purpose is to create any GUI that is displayed on the main frame. Remember, we are not changing the GUI, so we already have some insights on the data and the behavior of the setup() method on this data. The data that the setup() method will work on is:

    1. Container c = getContentPane();
    2. JButton exit = new JButton( "Exit" );
        This is an implementation of a "push" button.
        Exit
    3. JPanel buttonPanel = new JPanel() ;
        JPanel is a generic lightweight container on which we will place the the Exit button.
    4. Thread thrd = new Thread[ 15 ] ;
    5. JTextArea display = new JTextArea();
    6. We will use the above Java APIs in the following Basic Server Application Template.


       
    /** 
     * The tcpServer class implements an application.
     */
    class tcpServer extends JFrame {
        private data-type dt;
          ...
    
        // MyApp constructor
        public  tcpServer() {
           //initialization code
           //...
        } 
    
        public static void main(String[] args) {
            tcpServer app = new tcpServer()  ; 
            //minimal code
            //...
        }
    } 
      
    Figure 3: Basic Server Application Template


    In the above outline, it appears that all of the initialization code is done in the constructor. For ease of readability and maintainability, I prefer to spread the initialization using finer logical units. With this thought in mind, the tcpServer() constructor's logic looks like:
    1. Setup()
    2. SetupMenu()
    3. SetupToolbar()
    4. SetupPanels()
    5. SetupArrays()
    6. SetupButtons()
    7. startThreads()
    8. show() - Makes the JFrame visible
    The above logic takes place in the tcpServer() constructor's. Instead of placing all of the initialization in the constructor, we have already performed several passes of step-wise refinement. So that the outline/template now looks like:

      
    public tcpServer() {
    
       c = getContentPane() ;
    
    
       SetupMenu() ;
    
       SetupToolbar() ;
    
       SetupPanels() ;
    
       SetupArrays() ;
    
       SetupButtons() ;
    
       Setup() ;
    
       startThreads() ;
    
       show() ;
    
    }
    private void SetupMenu() {
       ...
    }
    private void SetupToolbar()  {
       ...
    }
    private void SetupPanels()  {
       ...
    }
    private SetupArrays()  {
       ...
    }
    private void SetupButtons()  {
       ...
    }
    private void Setup()  {
       ...
    }
    private void startThreads() {
       ...
    }
      
    Figure 4: setup() method


    What just happened was the initialization that normally might have been performed in the constructor and the setup() method has broken down into the above methods found in Figure 4. This process was/is known as top-down structured programming. What I have done is take a unit (tcpServer() constructor), and I have broken it down into finer units. It is like taking a dime and turning it into ten pennies. The pennies are still worth ten cents; the same value that the dime has. Even though I do this replacement in the context of the original constructor/Setup() method, this finer granularity makes it easier to see what I have done and what needs to be done. As you do this top-down-structured programming, don't be afraid to prototype what you are doing. The prototype allows you to evaluate your design, as you progress. Leonardo da Vinci probably evaluated the Mona Lisa as the painting progressed instead of waiting to the end. You don't want to wait to the end to find out what you are building doesn't work or is not what the customer wants.

    In object-oriented programming, programming revolves around the data. So in this style, the top is the data. It might be depicted as follows:

    Holland's OOP Programming Design Model
      
              +--------------+
              |      Data    |<----+  
              +-------+------+     | 
                      ^            |
                      |----------->+
                      V            ^
              +-------+------+     |
              |   Top-down   |     | 
              |  Structured  |<----+
              |  programming |     |
              |  on Classes  |     | (step-wise)
              |  and methods |     | (refinement)
              +--------------+     | (as needed) 
                      |            |
                      +------------+ 
     
      
    Figure 5: Holland's OOP Programming Design Model

    Putting it all together

    How do we put it all together?

    1. We will use the Basic Server Application Template
    2. Define the setup() method for initialization.
    3. Define a Gregorian calendar to enable us to get the current time.
        
      GregorianCalendar cal = new GregorianCalendar()  ;
        
    4. Define an exit push button.
        
      JButton exit = new JButton( "Exit" );
        
    5. Define a panel to contain the exit push button.
        
      JPanel buttonPanel = new JPanel() ;
        
    6. Add the exit push button to the button panel.
        
      buttonPanel.add( exit ) ;
        
    7. Using the BorderLayout manager add the buttonPanel to bottom of the content pane.
        
      c.add( buttonPanel , BorderLayout.SOUTH) ;
        
    8. Add an ActionListener to the exit push button.
        
      exit.addActionListener( this );
        
    9. Define a text area to display messages.
        
      JTextArea display = new JTextArea();
        
    10. Add the text area to the center of the content pane.
        
      c.add( new JScrollPane( display ),
                   BorderLayout.CENTER );
        
    11. Set the size of the main frame.
        
      setSize( 400, 400 );
        
    12. Set the initial location of the main frame on the terminal.
        
      setLocation( 10, 20 ) ;
        
    13. Make the main frame visible on the main frame.
        
      show();
        
    Figure 6: Putting it all together
    At this point, are we finished with this tutorial? The answer is no! All we have done is create the GUI objects in the setup() method. Remember the setup() method is called from the constructor and this call is made once during initialization. When we refer to Holland's OOP Programming Design Model, we see the relationship between the GUI, which is the data, and the method, which is the setup() method. The purpose of this tutorial was to create a multithreaded server. The Basic Client/Server Application is a single threaded application. We will modify the ServerRun() method so that it creates a new thread when a new client connects to the server.

    ServerRun() and run() Method modifications

    In the ServerRun() method, the data being manipulated is:

    1. server_socket - a ServerSocket object
        Listens for a Client connection to be made to this socket and accepts it. When the accept() method of ServerSocket is called, it returns a new Socket object that represents a new client connection that has attached to the server. Until a client attempts to connect, this method waits/listens. When a successful connection is made, a Socket object is returned.
    2. display - a JTextArea object
    3. socket - a Socket object
        This class implements client sockets. A socket is an endpoint for communication between two machines. The ServerSocket.accept() method returns a Socket object when there has been a successful connection.
    4. input - a BufferedReader object, which reads text from a character-input stream
      • getInputStream() returns a stream object that can be used to communicate through the socket.
    5. request - a MyThread object
    6. thrd - a Thread object
    Figure 7: ServerRun() and run() Method modifications
    The request and thrd objects are new in this modification. MyThread's run() method has become the workhorse method of this application. The data and method relationship should be obvious. When a successful client connection is made, a new Thread object is created and started. In the tutorial on Building a Basic Client/Server Application, an outline of the logic in the ServerRun() method looked like:

      
    try {
       while(true) {
          try {  // inner try construct
             while(true) {  // inner while construct
                ...
             }
          }
       }
    }
      
    In this tutorial, the above inner try and while constructs have been moved to MyThread's run() method.

    In this tutorial, an outline of the ServerRun() method looks like:

      
    try {
       while(true) {
          ...
       }
    }
      
    and the MyThread's run() method looks like:
      
    try {  // previously the inner try construct
       while(true) {  // previously the inner while construct
          ...
       }
    }
      
    Figure 8: Putting it all together


    In the following section, we will see an ourline of the tcpServer class Methods.

    Summary of tcpServer Methods

    The outline of the tcpServer class looks like:

      
    
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    
    /** **************************************************
     *  The purpose of the tcpServer class is to create a 
      server that 
     *  1- Creates a server main frame
     *  2- Establishes a server socker
     *  3- Accepts clients in a multithreaded environment
     ******************************************************/
    public class tcpServer extends JFrame implements  
                     ActionListener {
        
    
       /** **********************************************
        * This is the tcpServer constructor
        *************************************************/
        public  tcpServer() {
           
        }
    
        /**  **************************************************
         * The setThreadcount() method resets the thread count.
         *******************************************************/
        public  void setThreadcount( int a ) {
            
        }
    
        /**  *************************************************
         * The setUp() method does the intialization for the 
        *  application. The logic is
         *  1- Get the content pane
         *  2- Define a Gregorian Calendar to enable us to get 
        *      the current time.
         *  3- Define an exit push button.
         *  4- Define a panel to contain the exit push button.
         *  5- Add the exit push button to the button panel.
         *  6- Using the BorderLayout manager add the buttonPanel 
        *      to bottom of
         *     the content pane.
         *  7- Add an ActionListener to the exit push button.
         *  8- Define a text area to display mesaages.
         *  9- Add the text area to the center of the content pane.
         * 10- Set the size of the main frame.
         * 11- Set the initial location of the main frame on the 
        *      terminal.
         * 12- Make the main frame visible on the main frame.
         *
         ********************************************************/
        public  void setup() {
          
        }
    
       /**  ************************************
        * The setupThreads() method
        ******************************************/
        public void setupThreads() {
    
          thrd = new Thread[ 15 ] ;
        }
    
       /**  ****************************************************
        * The ServerRun() method in the server reads and writes 
        * data to the client. the logic for the ServerRun() 
        *    method is
        *  1- Create a ServerSocket object
        *  2- Create messages and display them in the text area.
        *  3- Loop while waiting for Client connections.
        *  4- Call ServerSocket accept() method and listen.
        *  5- Create an InputStreamReader based on the 
        *      socket.getInputStream() object
        *  6- Create a BufferedReader based on the  
        *      InputStreamReader object
        *  7- Create a new MyThread object
        *  8- Start the new MyThread object
        ********************************************************/
        public void ServerRun() {
           try {
                   
              while( loopCTL ) {
                                
                       // Construct handler to process the Client 
                       // request message.
                 try {
                                  
                 }
                 catch(Exception e) {
                   	       
                 }
              }   // End of while loop
                   
           }
           catch (IOException e) {
               
           }
        }
    
       /**  **************************************
        * This method responds to the exit button
        *  being pressed on the tcpServer frame.
         *****************************************/
       public void actionPerformed( ActionEvent e ) {
          if ( e.getSource() == exit )
              
       }
    
       /**  ************************************************
        * This method closes the socket connect to the server.
         ****************************************************/
       private void closeConnection() {
          
       }
    
       /** ********************************************
        * The sysExit() method is called in response to 
        * a close application event.
        ***********************************************/
       public void sysExit( int ext ) {
          l
       }
    
       /** ************************************************
        * The sysPrint method prints out debugging messages.
        ***************************************************/
       public void sysPrint( String str ) {
          
       }
    
       /** ***********************************************
        * The main() is called by Java when the tcpServer 
        * program is loaded.
        ***************************************************/
        public static void main(String args[]) {
           
        }
    }
      
    Figure 9: Summary of tcpServer Methods


    A summary of the tcpServer Methods looks like:

    Summary of tcpServer Methods
    Method Description
    actionPerformed() This method responds to the exit button being pressed on the tcpServer frame.
    closeConnection() is used to close the socket connection and the input/output streams.
    main() this is the entry point for the server application.
    ServerRun() this method is used to create the server socket, input/output streams and to listen for input from the socket.
    tcpServer() this is the class constructor used for initialization.
    setThreadcount() The setThreadcount() method resets the thread count.
    setUp() The setUp() method does the intialization for the application.
    sysExit() The sysExit() method is called in response to a close application event.
    sysPrint() TThe sysPrint method prints out debugging messages.
    Figure 10: Summary of tcpServer Methods


    Summary of tcpServer Inner Class MyThread

    The outline of the tcpServer's inner MyThread class looks like:

      
    
       /** ***********************************************************
        *  The purpose of the MyThread class is to create a thread of
        *  execution to respond to client requests.  A thread is a
        *  thread of execution in a program. The Java Virtual Machine
        *  allows an application to have multiple threads of execution
        *  running concurrently.
        **************************************************************/
       public class MyThread extends Thread {
          
    
          /** *********************************************************
           * The purpose of the MyThread() constructor is to used the
           * passed parameters to initialize MyThread class level
           * variables.
           **************************************************************/
          public MyThread( tcpServer tps , Socket socket , int trd_Cnt ) throws Exception {
             
          }
    
          /** *********************************************************
           * The run() method responds to the client's request.
           **************************************************************/
          public void run() {
             
             try {
                while( loopCTL2 ) {
                   
                }
             }
             catch(Exception e) {
                 
             }
          }
    
       }
      
    Figure 11: Summary of tcpServer Inner Class MyThread


    Summary of Inner Class MyThread Methods
    Method Description
    MyThread The purpose of the MyThread() constructor is to used the passed parameters to initialize MyThread class level variables.
    run() The run() method responds to the client's request.

    Outline of tcpClient Methods

    An outline of tcpClient Methods are shown below.
     
    import javax.swing.*;
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    import java.net.*;
    
    public class tcpClient extends JFrame implements  ActionListener {
       
       public tcpClient() {
          super( "Client" ) ;
    
          setUp() ;
    
          connect() ;
    
          run() ;
    
          closeConnection() ;
       }
    
       /** The setUp() method does the intialization for the application */
       private void setUp() {
         
    
       }
    
    /** The connect() method does the intialization of the client socket
     *  on localhost and port 5050*/
       private void connect() {
          // connect to server
          
       }
    
       private void sendData(String str) {
          
       }
    
       private void run() {
          
       }
    
       /**
        * This method responds to the send, cancel or exit button
        *  being pressed on the tcpClient frame.
        */
       public void actionPerformed( ActionEvent e )    {
          if ( e.getSource() == clear ) {
             enterBox.setText( "" );
          }
          // get user input and send it to server
          else if ( e.getSource() == send ) {
             sendData( enterBox.getText() );
             display.append( "\n" +  enterBox.getText() ) ;
          }
          else if ( e.getSource() == exit ) {
             closeConnection() ;
          }
       }
    
       private void closeConnection() {
          
       }
    
       public static void main(String[] args) {
          final tcpClient client = new tcpClient() ;
    
          client.addWindowListener(
             new WindowAdapter() {
                public void windowClosing( WindowEvent e )
                {
                   client.closeConnection() ;
                }
             }
          );
       }
    
       class WindowHandler extends WindowAdapter {
          tcpClient tcpC;
    
          public WindowHandler( tcpClient t ) { tcpC = t; }
    
          public void windowClosing( WindowEvent e ) { 
                                tcpC.closeConnection(); }
       }
    
    }
     
    Figure 12: Outline of tcpClient Methods

    Summary of tcpClient Methods

    The Summary of tcpClient Methods are shown below.

    Summary of tcpClient Methods
    Method Description
    actionPerformed() This method responds to the send, clear, or exit buttons being pressed on the tcpClient frame.
    main() This method is the main entry point called by the JVM.
    closeConnection() is used to close the socket connection and the input/output streams.
    connect() this method is used to connect to the socket.
    runClient() this method is used to
    1. Create input/output streams
    2. Make requests of the server in the form of messages sent to the server
    3. Listen for input from the socket.
    setUp() this method is used to setup and allocate the GUI objects.
    tcpClient() this is the class constructor used for initialization.
    Figure 13: Summary of tcpClient Methods


  • Definitions

    applet

      is a program designed to be executed from within another application, such as a browser like Netscape. An applet is different from an application. Applets cannot be executed directly from the operating system like an application.

    application server

      Also called an appserver. A program that handles all application operations between users and an organization's backend business applications or databases. Application servers are typically used for complex transaction-based applications. To support high-end needs, an application server has to have built-in redundancy, monitors for high-availability, high-performance distributed application services and support for complex database access.

      Sometimes referred to as a type of middleware, application servers occupy a large chunk of computing territory between database servers and the end user, and they often connect the two. However, don't limit yourself to traditional database programs. Once you visualize airport management packages, you can start to visualize the only limit is your imagination.

    asynchronous

      Most communication between computers and devices is asynchronous -- it can occur at any time and at irregular intervals. Communication within a computer, however, is usually synchronous and is governed by the microprocessor clock. Signals along the bus, for example, can occur only at specific points in the clock cycle.

    concurrently

      In programming, this refers to the ability of multiple programs running at the same time. This can only happen if there are multiple processors. If there is one processor, then the programs are timeslicing.

    distributed processing

      Refers to any of a variety of computer system configurations that comprise more than one computer/processor to run an application. This includes parallel processing or multiprocessing, in which a single computer uses more than one CPU to execute programs. More often, however, distributed processing refers to local-area networks (LANs) designed so that a single program can run simultaneously on various computers at one site or at various sites. Most distributed processing systems contain sophisticated software that detects idle CPUs on the network and parcels out programs to utilize them.

      Another form of distributed processing involves distributed databases, databases in which the data is stored across two or more computer systems. The database system keeps track of where the data is so that the distributed nature of the database is not apparent to users.

    HTTP

      Short for HyperText Transfer Protocol, the underlying protocol used by the World Wide Web. HTTP defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. For example, when you enter a URL in your browser, this actually sends an HTTP command to the Web server directing it to fetch and transmit the requested Web page.

    modal window

      A modal window is any type of window that is a child (secondary window, dialog) to a parent window and must run to completion or exit before returning control to the parent. This means that no other window can be accessed while this secondary window is active. An example of this is the Save dialog in a text editor.

    modeless window

      Similar to a modal window as it is a secondary window (i.e., child, dialog) that stays active on the user's screen until exited. Modeless windows can be minimized or hidden behind other windows. Unlike a modal window, a modeless window allows the user to continue accessing other windows (parent window) while the modeless window is open.

    multiprocessing

      Refers to a computer system's ability to support more than one process (program) at the same time. Multiprocessing operating systems enable several programs to run concurrently.

      Multiprocessing or multiple processors involves more than one processor. Multiprocessing is not the same as multitasking/multithreading. Java supports multitasking/multithreading. The Windows operating system supports multitasking/multithreading. Windows does not support multiprocessing.

    multithreading

      This is the capability of an operating system to execute different parts of a program, called threads, simultaneously. In reality, these threads run on a single processor, and these threads do not run at the same time or simultaneously. In effect, these threads are timeslicing. On a single processor, only one program can be running at a time. The programmer must carefully design the program in such a way that all the threads can timeslice without interfering with each other.

    n-tier

    
                                   Tier 3
                                  +---------+
                               +->| Printer |
                               |  +---------+
                               |
      Tier 1        Tier 2     |    Tier 4
    +--------+     +--------+  |  +------+
    | Client |<--->| Server |<-+->| DBMS |
    +--------+     +--------+  |  +------+
       GUI         Application .     DB
                    Server     . 
                               .    Tier n
                               |  +---------+
                               +->| whatever|
                                  +---------+                           
     
    Figure 14: n-tier


    process

      A process is an executing program. An example could be a running text editor, word processor, or a browser.

    realtime

      Real-time processing is the application of hardware and software systems which are subject to a "real-time constraint"—i.e., operational deadlines from stimuli/data input to output or the system response to that stimuli.

    synchronous - Means that an event occurs at regular intervals. The opposite of synchronous is asynchronous.

    TCP - Abbreviation of Transmission Control Protocol, and pronounced as separate letters. TCP is one of the main protocols in TCP/IP networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.

    template - establishes or serves as a pattern.

    thread

      In programming, this refers to a part of a program that can execute concurrently with and independently of other parts of the program.

    timeslicing

      In programming, this refers to how the operating system parcels out time for the various programs to run/execute. This is usually done on a priority basis, with the operating system having the highest priority. Requests for system services usually result in a program/thread yielding its execution time and going into a wait state. When this happens, the operating system grants another program/thread execution time. In some systems, a program/thread is allocated a certain amount of time. When this time period is reached, the program/thread must yield to another program/thread.

    Two-tier - A client/server architecture where the GUI runs on the client and the business liogic runs on the server.

    
      Tier 1        Tier 2         
    +--------+     +--------+     
    | Client |<--->| Server |
    +--------+     +--------+     
       GUI         |Business|    
                   |Logic   |       
                   +--------+               
     
    Figure 15: 2-tier


    Three-tier - A client/server architecture consisting of three well-defined and separate processes.

    
      Tier 1        Tier 2         Tier 3
    +--------+     +--------+     +------+
    | Client |<--->| Server |<--->| DBMS |
    +--------+     +--------+     +------+
       GUI          Application      DB
                    Server 
     
    Figure 16: 3-tier





    HOME Consulting Design Maintenance Project Testing Training Turnkey Java C++ SQL HTML JavaScript

    © 2002 - 2013 All Rights Reserved Total Application Works