468,532 Members | 1,708 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,532 developers. It's quick & easy.

blocking i/o vs. non blocking i/o (performance)

Hi,
I'm writing a proxy application for rfb protocol (vnc), but i'm not
satisfied with it's performance. I'm using blocking i/o and the app
just read(...) from source and the write(...) to destination. The
performance diference between the client directly connected to the
server and the client passing thru the proxy is very visible. Does
non-blocking i/o solves my problem? Maybe the problem here is the
unnecessary(?) wait in write(...) function.

thank you.
obs. sorry about my poor english.
Nov 13 '05 #1
3 8417
On 9 Oct 2003 21:03:12 -0700, an***@kelmanson.net (Andre Kelmanson)
wrote in comp.lang.c:
Hi,
I'm writing a proxy application for rfb protocol (vnc), but i'm not
satisfied with it's performance. I'm using blocking i/o and the app
just read(...) from source and the write(...) to destination. The
performance diference between the client directly connected to the
server and the client passing thru the proxy is very visible. Does
non-blocking i/o solves my problem? Maybe the problem here is the
unnecessary(?) wait in write(...) function.

thank you.
obs. sorry about my poor english.


You need to ask in a newsgroup that supports your particular compiler
and operating system combination.

None of proxy, rfb, vnc, read(), write(), or non-blocking i/o are part
of the C language or its library, the topic here. C has no built-in
networking support at all. All such features are specific to the
implementation.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #2
an***@kelmanson.net (Andre Kelmanson) wrote:
# Hi,
# I'm writing a proxy application for rfb protocol (vnc), but i'm not
# satisfied with it's performance. I'm using blocking i/o and the app
# just read(...) from source and the write(...) to destination. The
# performance diference between the client directly connected to the
# server and the client passing thru the proxy is very visible. Does
# non-blocking i/o solves my problem? Maybe the problem here is the
# unnecessary(?) wait in write(...) function.

Non-blocking I/O can be useful if you are trying to do multiple simultaneous
reads and writes. If your process is doing a single read and write, that is
going to take the same amount of time whether your process suspends while
the kernel moves bytes or your process twiddles its thumb during that time.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
No pleasure, no rapture, no exquiste sin greater than central air.
Nov 13 '05 #3
You may perform a task in another thread in parallel to data transfer even
with blocking IO. You should detect the bottleneck youself to determine
whether you need a multitasking. May be it is your communication channel too
slow and non-blocking IO does not help.
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jonathan Fine | last post: by
3 posts views Thread by Mario | last post: by
3 posts views Thread by Robert A. van Ginkel | last post: by
2 posts views Thread by Bruce Vander Werf | last post: by
7 posts views Thread by Michi Henning | last post: by
11 posts views Thread by Michi Henning | last post: by
16 posts views Thread by William Stacey [MVP] | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.