Re: [問題]JAVA有類似C的shared memory的功能嗎

看板java作者時間19年前 (2006/11/19 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串11/12 (看更多)
※ 引述《Lordaeron.bbs@ptt.cc (Terry)》之銘言: > ※ 引述《qrtt1.bbs@bbs.sayya.org (foolish)》之銘言: > : a client, a thread是蠻浪費的。 > : 如果thread切換的頻率不高,client也不多倒是可以考慮。 > : 不然時間都花在context-switch上面了。 > 不然可行性是如何做呢? 不a client , a thread 哦, 怕時間都花在context-switch上面 如何做呢? 俺只是藉著之前分享的文章講了一些作者說明的困境, 而我也覺得小有認同罷了:) <% About one year ago, a client of the company where I work asked us to develop a router for telephony protocols (i.e., protocols used for communication between a SMS center and external applications). Among the requirements was that a single router should be able to support at least 3,000 simultaneous connections. It was clear that we could not use the traditional thread-pooling approach. Most thread libraries do not scale well, because the time required for context switching increases significantly with the number of active threads. With a few hundred active threads, most CPU time is wasted in context switching, with very little time remaining for doing real work. As an alternative to thread pooling, we decided to use I/O multiplexing. In this approach, a single thread is used to handle an arbitrary number of sockets. This allows servers to keep their thread count low, even when operating on thousands of sockets, thereby improving scalability and performance significantly. Unfortunately, there is a price to pay: an architecture based on I/O multiplexing is significantly harder to understand and to implement correctly than one based on thread pooling. %> -- ※ Origin: SayYA 資訊站 <bbs.sayya.org> ◆ From: pc210-59-94-161.nutn.edu.tw
文章代碼(AID): #15Nqfg00 (java)
討論串 (同標題文章)
文章代碼(AID): #15Nqfg00 (java)