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
相关阅读
how to develop Java EE 6 application再问一个信用分数知多少?Poor or Excellent?免费查询,尽快提高到700分关于实现一个Web Application的问题各位写app的童鞋 (转载)大家一般都用哪个 JSON 的JAR库呀?请教:performance issue如何学spring和hibernate版主啊,干活了,mark一下zhaoce的帖子吧对 spring 的 exception 处理方式真是不适应怎么实现 twitter 桌面程序请教一个java web application设计的问题大妈来奔,有包子吃吗?Java方向的面试会问什么中国人北美甲骨文用户组2012年隆重推出大型IT新手入门讲座 (转弱问:System.out.println( Math.sqrt( 4 ) ); 输出2.0。如果要出整数2,该怎么写?招social media and Java developereclipse can't resolve transitive dependency projects ?求java UML toolhibernate question? session and hibernate.cfg.xml