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

Discussion in 'C Programming' started by Andre Kelmanson, Oct 10, 2003.

  1. 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.
     
    Andre Kelmanson, Oct 10, 2003
    #1
    1. Advertising

  2. Andre Kelmanson

    Jack Klein Guest

    On 9 Oct 2003 21:03:12 -0700, (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
     
    Jack Klein, Oct 10, 2003
    #2
    1. Advertising

  3. Andre Kelmanson

    Derk Gwen Guest

    (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.
     
    Derk Gwen, Oct 10, 2003
    #3
  4. 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.
     
    Valentin Tihomirov, Oct 12, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward L. Hepler

    "non-blocking" read in VHDL?

    Edward L. Hepler, Jan 12, 2004, in forum: VHDL
    Replies:
    0
    Views:
    559
    Edward L. Hepler
    Jan 12, 2004
  2. Hendra Gunawan
    Replies:
    1
    Views:
    12,586
    Allan Herriman
    Apr 8, 2004
  3. nukleus
    Replies:
    14
    Views:
    836
    Chris Uppal
    Jan 22, 2007
  4. Christian
    Replies:
    5
    Views:
    738
    Esmond Pitt
    Dec 2, 2007
  5. Serge Savoie
    Replies:
    4
    Views:
    271
    Serge Savoie
    Oct 1, 2008
Loading...

Share This Page