2024年10月5日
摘要: 常用于网络文件传输 正常的网络传输 4次 上下文切换与拷贝 如下图 零拷贝使用诸如 mmap+write 或 sendfile ,只有一次cpu拷贝+mmap/write 阅读全文
posted @ 2024-10-05 16:43 towboat 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 代码大概如下 do { old_value = atomic_load(&c->count); // 获取当前值 //1 } while (!atomic_compare_exchange_weak(&c->count, &old_value, old_value + 1)); 1处c->count 阅读全文
posted @ 2024-10-05 00:22 towboat 阅读(0) 评论(0) 推荐(0) 编辑