Other - blocking & basic understanding of synchronization

1 Overview

  1. Some concepts, always confused about
    1. Synchronous Asynchronous
    2. Blocking non-blocking

2. Prepare

  1. Scenes
    1. Character
      1. client
        1. Initiate a request
        2. Accept the request
      2. server
        1. Accept the request
        2. Perform an operation
        3. Returns a response
    2. behavior
      1. Model is generally a C / S model

3. blocking & non-blocking

  1. Outline
    1. A description of the behavior of the client
  2. behavior
    1. Clog
      1. requesting client
      2. client server processed place waiting
      3. client server received a response and move on
    2. Non-blocking
      1. requesting client
        1. Of course most of the time, make sure the server receives a request, consider the simple words, you can not mention
      2. client to move forward
    3. focus point
      1. after the client sends a request to the behavior server

4. Synchronous & asynchronous

  1. Outline
    1. A description of the behavior of the server
  2. behavior
    1. Synchronize
      1. server to accept requests
      2. server processing request
      3. server returns a response
    2. asynchronous
      1. server to accept requests
      2. server returns a response
        1. Receipt of the request
      3. server processing request
      4. server returns a response
        1. Process is completed
    3. focus point
      1. server behavior after receipt of the request
    4. other
      1. After processing the request server, client know that there are multiple ways processed
        1. client polling
          1. client initiative
          2. Repeatedly asked server case
        2. client monitor
          1. server initiative
          2. Dealt with immediately notify the client

5. Combination

  1. Blocking synchronization
    1. The most common model
      1. the easiest
  2. Blocking asynchronous
    1. Two forced a little model
      1. client obviously can continue to move forward, have to wait until the process server silly completed
  3. Non-blocking synchronization
    1. Two forced a little model
      1. server name may continue to accept other requests after return, but still blocked where
  4. Non-blocking asynchronous
    1. Common models
      1. Most efficient

Guess you like

Origin www.cnblogs.com/xy14/p/11279956.html