Buffered vs non buffered, which one to use?

前端 未结 5 652
醉酒成梦
醉酒成梦 2021-02-05 19:58

I am sorry if this is a duplicate but I was not able to find a definitive answer to what is the best practice for each type.

I would like to know what the appropriate co

5条回答
  •  天命终不由人
    2021-02-05 20:54

    " Is there a formula of sorts that will always tell you what is appropriate?"

    If there was, it would already be in the libraries and would not be a design decision that you would have to make.

    Since there's no pat answer, you have to make the design decision, you have to actually think about it.

    Or, you can try both options and see which is "better" based on your unique problem and your unique criteria.

    Most standard I/O libraries are buffered. That's a hint that most I/O benefits from buffering. But not all. Games, for instance, need unbuffered access to the game controls.

提交回复
热议问题