问题描述
嘿,请问我问的是小问题,请介意.
Hey please don't mind if I am asking trivial question, but, please can somebody help me with this..
推荐答案
当您执行大量随机读/写操作时,此功能很有用.SQLite3甚至还有一个选项可以替换 seek()
+ read()
和 seek()
+ write()
和 pread()/pwrite()
.
It's useful when you do a lot of random read/write operations. There is even an option for SQLite3 that replaces seek()
+ read()
and seek()
+ write()
with pread()/pwrite()
.
优点: seek()
+ read()
和 seek()
+ write()
都是一对系统调用,而 pread()
和 pwrite()
是单个系统调用.通常,一个普遍的事实是,系统调用程序的次数越少,它的效率就越高.
The advantage: seek()
+ read()
and seek()
+ write()
both are the pairs of system calls while pread()
and pwrite()
are single system calls. It's usually an universal truth that the less system calls program issues the more efficient it is.
这篇关于与fwrite和fread相比,pwrite和pread有何优势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!