<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    這是我吹牛的地方

    想怎么吹就怎么吹

    知道什么叫同步和異步嗎?

    In synchronous receiving, while the server is waiting to receive data from a client, if the stream is empty the main thread will block until the request for data is satisfied. Hence, the server cannot do anything else until it receives data from the client. If another client attempts to connect to the server at that time, the server cannot process that request because it is blocked on the first client. This behavior is not acceptable for a real-world application where we need to support multiple clients at the same time.

    In asynchronous communication, while the server is listening or receiving data from a client, it can still process connection requests from other clients as well as receive data from those clients. When a server is receiving asynchronously, a separate thread (at the OS level) listens on the socket and will invoke a callback function (specified when the asynchronous listening was commenced) when a socket event occurs. This callback function in turn will respond and process that socket event. For example, if the remote program writes some data to the socket, a "read data event" (callback function you specify) is invoked; it knows how to read the data from the socket at that point.

    簡而言之,同步是一對一的,異步是一對多的。我翻譯的太牛了,這么多英文就讓我一句話就概括了。

    posted on 2006-09-19 14:42 西門吹牛 閱讀(3064) 評論(7)  編輯  收藏

    評論

    # re: 知道什么叫同步和異步嗎? 2006-11-06 15:34 chicken

    你翻譯的很垃圾阿 看了英文才懂。。。  回復(fù)  更多評論   

    # re: 知道什么叫同步和異步嗎? 2006-12-01 14:50 心內(nèi)求法

    好像不是翻譯的問題,是理解的問題,呵呵  回復(fù)  更多評論   

    # re: 知道什么叫同步和異步嗎? 2008-07-18 12:50 dog

    就是一夫多妻和一夫一妻  回復(fù)  更多評論   

    # re: 知道什么叫同步和異步嗎? 2009-04-21 14:10 恩 恩! 真是吹牛的好地方

    ...  回復(fù)  更多評論   

    # re: 知道什么叫同步和異步嗎?[未登錄] 2009-06-11 17:10 無名

    概括得好,頂?。。?!再頂?。。。?nbsp; 回復(fù)  更多評論   

    # re: 知道什么叫同步和異步嗎? 2009-07-12 01:21 卡人力窩里反

    英文單詞的原意和中文的翻譯之間,差別很大,甚至是南轅北轍的!  回復(fù)  更多評論   

    # re: 知道什么叫同步和異步嗎? 2009-07-30 14:52 北京的太陽

    在同步接收方式下,當(dāng)服務(wù)器等待從客戶端的數(shù)據(jù)時,如果傳輸流是空的,主線程會進(jìn)入阻塞狀態(tài),直到(向客戶端的)數(shù)據(jù)請求被滿足。因此,服務(wù)器不能做其他的操作,直到接收到客戶端的數(shù)據(jù)。如果同時有另外一個客戶端試圖連接服務(wù)器,服務(wù)器不能夠處理請求,因為主線程被第一個客戶端設(shè)置為阻塞。這種(同步)方式對于需要在同一時間支持多客戶端的實際應(yīng)用(程序)是不能夠被接受的。
    在異步通信方式下,當(dāng)服務(wù)器監(jiān)聽或者接受一個客戶端的數(shù)據(jù)時,它能夠同時連接其他的客戶端并且從其他的客戶端接收數(shù)據(jù)。當(dāng)服務(wù)器異步地接收(數(shù)據(jù)),一個單獨(dú)的現(xiàn)成(操作系統(tǒng)級別)監(jiān)聽socket并且當(dāng)發(fā)生socket事件時,會調(diào)用一個響應(yīng)函數(shù)(指定異步監(jiān)聽什么時候開始)。響應(yīng)函數(shù)會輪流地響應(yīng)和處理socket事件。例如:如果遠(yuǎn)程程序向一個socket寫一些數(shù)據(jù),一個“寫數(shù)據(jù)事件”(你指定的響應(yīng)函數(shù))被調(diào)用,在那一時刻它(函數(shù))知道如何從socket讀數(shù)據(jù)。  回復(fù)  更多評論   


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    <2006年9月>
    272829303112
    3456789
    10111213141516
    17181920212223
    24252627282930
    1234567

    導(dǎo)航

    統(tǒng)計

    常用鏈接

    留言簿(5)

    隨筆檔案

    文章檔案

    相冊

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲国产黄在线观看| 国产成人3p视频免费观看| 日韩精品成人无码专区免费| 成人免费福利电影| 免费在线看片网站| 亚洲精品V欧洲精品V日韩精品| 久久丫精品国产亚洲av| 亚洲日韩一区精品射精| 亚州**色毛片免费观看| 久久永久免费人妻精品| 免费可以在线看A∨网站| 亚洲av中文无码| 亚洲av综合avav中文| 亚洲精品午夜国产va久久| 日韩在线观看视频免费| 色欲色香天天天综合网站免费| A级毛片内射免费视频| 成人伊人亚洲人综合网站222| 日本亚洲视频在线| 亚洲色欲色欲www| 一级黄色免费毛片| 7x7x7x免费在线观看| 亚洲&#228;v永久无码精品天堂久久 | 理论片在线观看免费| 99久久免费精品视频| 国产色婷婷精品免费视频| 亚洲av无码国产精品色午夜字幕 | 亚洲AV无码专区亚洲AV伊甸园| 亚洲 欧洲 视频 伦小说| 国产精品高清免费网站| 免费精品国偷自产在线在线| 亚洲一本大道无码av天堂| 亚洲另类小说图片| 久久av免费天堂小草播放| 成人免费毛片内射美女APP| 国产成人精品日本亚洲| 国产亚洲精品精品精品| 久久A级毛片免费观看| 亚洲福利精品电影在线观看| 亚洲人成高清在线播放| 最新久久免费视频|