D*s
3 楼
Where did you get the data saying that NB Socket's performance
is bad? any link please.
You said I can use non-blocking socket along with Stream. Can you
please tell some details?
As I know if you don't use nio, which has select(), you actually
can't use non-blocking socket because busy waiting is a BAD idea.
Did you just refer to this busy waiting when you said NB socket's
performance?
【在 f*****g 的大作中提到】
:
: Yes you can. But it is better using nio. The best, it is
: still use tradition Java socket. NB Socket's performance
: is too bad.
is bad? any link please.
You said I can use non-blocking socket along with Stream. Can you
please tell some details?
As I know if you don't use nio, which has select(), you actually
can't use non-blocking socket because busy waiting is a BAD idea.
Did you just refer to this busy waiting when you said NB socket's
performance?
【在 f*****g 的大作中提到】
:
: Yes you can. But it is better using nio. The best, it is
: still use tradition Java socket. NB Socket's performance
: is too bad.
e*g
4 楼
short answer: no. no such API/adapter.
middle answer: don't use socket channel, mostly you don't need it,
it just makes your program complicated without visible performance
gain. keep code simple and scalable, put more servers, it's cheap.
long answer: if you do reach some kind of limit and you must use
socket channel. sure you can write your own plumbing and make
adapters of channel->stream, but then you end up with thousands
of threads and defeat the purpose of select(). in this
【在 D*********s 的大作中提到】
: Where did you get the data saying that NB Socket's performance
: is bad? any link please.
: You said I can use non-blocking socket along with Stream. Can you
: please tell some details?
: As I know if you don't use nio, which has select(), you actually
: can't use non-blocking socket because busy waiting is a BAD idea.
: Did you just refer to this busy waiting when you said NB socket's
: performance?
middle answer: don't use socket channel, mostly you don't need it,
it just makes your program complicated without visible performance
gain. keep code simple and scalable, put more servers, it's cheap.
long answer: if you do reach some kind of limit and you must use
socket channel. sure you can write your own plumbing and make
adapters of channel->stream, but then you end up with thousands
of threads and defeat the purpose of select(). in this
【在 D*********s 的大作中提到】
: Where did you get the data saying that NB Socket's performance
: is bad? any link please.
: You said I can use non-blocking socket along with Stream. Can you
: please tell some details?
: As I know if you don't use nio, which has select(), you actually
: can't use non-blocking socket because busy waiting is a BAD idea.
: Did you just refer to this busy waiting when you said NB socket's
: performance?
D*s
5 楼
This makes sense. Thanks.
【在 e***g 的大作中提到】
: short answer: no. no such API/adapter.
: middle answer: don't use socket channel, mostly you don't need it,
: it just makes your program complicated without visible performance
: gain. keep code simple and scalable, put more servers, it's cheap.
: long answer: if you do reach some kind of limit and you must use
: socket channel. sure you can write your own plumbing and make
: adapters of channel->stream, but then you end up with thousands
: of threads and defeat the purpose of select(). in this
【在 e***g 的大作中提到】
: short answer: no. no such API/adapter.
: middle answer: don't use socket channel, mostly you don't need it,
: it just makes your program complicated without visible performance
: gain. keep code simple and scalable, put more servers, it's cheap.
: long answer: if you do reach some kind of limit and you must use
: socket channel. sure you can write your own plumbing and make
: adapters of channel->stream, but then you end up with thousands
: of threads and defeat the purpose of select(). in this
相关阅读
Re: Code Naming StyleRe: Do anyone know a good websit containing the source code of JavaRe: How to creat a newinstance with a param??Re: 这功能咋做水平比较高?Re: 如何读取serial port in JavaRe: SWING APPLET如何显示IMAGE?Re: 请教SWING的问题Re: Question on mouse click on image in Jdk 1.1火车旅行家在中文WINDOWS下无法运行的大问题已被解决Re: native thread 和green threadRe: Question: Java SynchronizationRe: 哪位用过GIME (Java Chinese input) in Unix Netscap第十章 编程实例Re: abstract classes GRAPHICSRe: ABout BrowserJAVA程序设计语言讲座 第二部分Re: experience of handling local files in applet?The shape of JVM stack frameStack Frame of your JVM implementationRe: JAVA有没有象C中SYSTEM那样的METHOD?