<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.

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

    posted on 2006-09-19 14:42 西門(mén)吹牛 閱讀(3065) 評(píng)論(7)  編輯  收藏

    評(píng)論

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

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

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

    好像不是翻譯的問(wèn)題,是理解的問(wèn)題,呵呵  回復(fù)  更多評(píng)論   

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

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

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

    ...  回復(fù)  更多評(píng)論   

    # re: 知道什么叫同步和異步嗎?[未登錄](méi) 2009-06-11 17:10 無(wú)名

    概括得好,頂!!!!再頂!!!!  回復(fù)  更多評(píng)論   

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

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

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

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


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


    網(wǎng)站導(dǎo)航:
     
    <2006年12月>
    262728293012
    3456789
    10111213141516
    17181920212223
    24252627282930
    31123456

    導(dǎo)航

    統(tǒng)計(jì)

    常用鏈接

    留言簿(5)

    隨筆檔案

    文章檔案

    相冊(cè)

    搜索

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 无码日韩人妻AV一区免费l| 亚洲福利电影一区二区?| 久久水蜜桃亚洲AV无码精品| 免费看污成人午夜网站| 亚洲色图.com| 蜜桃AV无码免费看永久| 亚洲无限乱码一二三四区| 91成人免费在线视频| 亚洲高清视频在线| 日本一线a视频免费观看| 色妞www精品视频免费看| 免费观看亚洲人成网站| 一级视频在线免费观看| 亚洲综合av永久无码精品一区二区| 国产免费牲交视频免费播放| 亚洲s色大片在线观看| 最好看最新的中文字幕免费| 亚洲国产成人精品无码区在线秒播 | 国产一级a毛一级a看免费人娇| 亚洲日韩小电影在线观看| 免费91最新地址永久入口| 亚洲av极品无码专区在线观看| 日本免费中文字幕在线看| 污污视频网站免费观看| 亚洲色精品88色婷婷七月丁香| 一级毛片**不卡免费播| 精品亚洲AV无码一区二区三区 | 国产成人精品日本亚洲网站| 24小时日本电影免费看| 亚洲风情亚Aⅴ在线发布| 亚洲欧洲美洲无码精品VA| 亚洲视频在线观看免费视频| 亚洲国产高清国产拍精品| 日本亚洲欧洲免费天堂午夜看片女人员| 在线看无码的免费网站| 亚洲国产综合AV在线观看| 亚洲色无码一区二区三区| 久久WWW免费人成一看片| 美女被爆羞羞网站免费| 亚洲伊人久久大香线蕉苏妲己| 国产又长又粗又爽免费视频 |