關於異步:
在我看來,沒有異步調用,只有異步IO。而在不少程序員的術語異步調用,異步執行。都是不存在的,
爲何?
異步調用,就是任務分派,分派到其餘機器上然後等待任務完成,獲取任務結果。這裏的異步指的是什麼?
恐怕咱們並不明白?任務分派?
異步執行,異步執行模式,是指語句在異步執行模式下,各語句執行結束的順序與語句執行開始的順序並不必定相同。
(來自百度百科)。這個描述很可怕,很不明所喲。
想到這裏,我在wiki百科上進行搜索: Asynchronous function,
獲得的類似的結果只有:程序員
- Message passing (section Synchronous versus asynchronous message passing)
- Qt (software)available natively in C++: signals and slots, introspection and asynchronous function calls. Main article: List of platforms supported by Qt Qt works
- Asynchronous semaphore
- Asynchronous method invocation
- Asynchronous circuit
- Ajax (programming) (redirect from Asynchronous Javascript and XML)
- Asynchronous I/O
- Asynchronous system
- Induction motor (redirect from Asynchronous electric motor)
- Asynchronous Transfer Mode
- Callback (computer programming) (redirect from Asynchronous callback)
- Induction generator (redirect from Asynchronous generator)
- Parallel computing (redirect from Asynchronous programming)
這是部份內容。比較有意思的就是Asynchronous method invocation(要明白什麼意思,請自行wiki 地址在https://en.wikipedia.org/wiki/Asynchronous_method_invocation),Asynchronous I/O。而其餘部分的異步的修飾,基本上是其餘的含義。
哀,對於異步,究竟該如何理解。我想只能根據這些特定的術語來理解了。asynchrous I/O,則是多路複用(select、poll、epoll、kqueue)和nonblocking的結合。
他們有這樣的特色
1.節省CPU,不用讓CPU等待IO
2.屢次執行IO,的不肯定性(比較相似的Asynchronous method invocation,有polling)
異步