java - Mac 是否支持零复制原理

标签 java linux macos operating-system

您好,尝试了解零复制原理。维基百科说

Several operating systems support zero-copying of files through specific APIs.

The Linux kernel supports zero-copy through various system calls, such as sys/socket.h's sendfile, sendfile64, and splice. Some of them are specified in POSIX and thus also present in the BSD kernels or IBM AIX, some are unique to the Linux kernel API.

Microsoft Windows supports zero-copy through the TransmitFile API.

Java input streams can support zero-copy through the java.nio.channels.FileChannel's transferTo() method if the underlying operating system also supports zero copy.[4]

我没有看到任何提及 OSX 的内容,尽管它说存在于 BSD 内核中。

但是http://www.bigfastblog.com/zero-copy-transfer-data-faster-in-ruby博客说 OSX 不支持它。

最佳答案

有一个man page for sendfile对于 OS X。虽然它没有引用零复制,但它确实将 sendfile 作为系统调用(与打开/读/写/关闭周围的一些包装器相反),所以我认为可以很安全地假设它不会涉及将文件复制到用户空间。

关于java - Mac 是否支持零复制原理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30772456/

相关文章:

java - Java 中数组列表出现越界异常错误

java - Java 循环和 if 语句中的随机数

java.lang.IllegalArgumentException : argument type mismatch while using Reflection 异常

java - Jackson 2 是否有相当于 Jackson 1 的 StdSerializerProvider 的?

linux - 如何在大型代码库中运行 ctags?

php - 大量用户的 Cron 作业管理

objective-c - OS X(Cocoa 等)创建可取消周期性操作的惯用方法

linux - OS X 相当于 SO_BINDTODEVICE

macos - 无法 brew 链接qt

apache - 使用 Apache 修复别名目录上的 403 Forbidden