Other - blocking & basic understanding of synchronization
Others
2019-08-01 09:52:42
views: null
1 Overview
- Some concepts, always confused about
- Synchronous Asynchronous
- Blocking non-blocking
2. Prepare
- Scenes
- Character
- client
- Initiate a request
- Accept the request
- server
- Accept the request
- Perform an operation
- Returns a response
- behavior
- Model is generally a C / S model
3. blocking & non-blocking
- Outline
- A description of the behavior of the client
- behavior
- Clog
- requesting client
- client server processed place waiting
- client server received a response and move on
- Non-blocking
- requesting client
- Of course most of the time, make sure the server receives a request, consider the simple words, you can not mention
- client to move forward
- focus point
- after the client sends a request to the behavior server
4. Synchronous & asynchronous
- Outline
- A description of the behavior of the server
- behavior
- Synchronize
- server to accept requests
- server processing request
- server returns a response
- asynchronous
- server to accept requests
- server returns a response
- Receipt of the request
- server processing request
- server returns a response
- Process is completed
- focus point
- server behavior after receipt of the request
- other
- After processing the request server, client know that there are multiple ways processed
- client polling
- client initiative
- Repeatedly asked server case
- client monitor
- server initiative
- Dealt with immediately notify the client
5. Combination
- Blocking synchronization
- The most common model
- the easiest
- Blocking asynchronous
- Two forced a little model
- client obviously can continue to move forward, have to wait until the process server silly completed
- Non-blocking synchronization
- Two forced a little model
- server name may continue to accept other requests after return, but still blocked where
- Non-blocking asynchronous
- Common models
- Most efficient
Origin www.cnblogs.com/xy14/p/11279956.html