摘要: monoio 是字节跳动开源的一个Rust异步运行时,与其它运行时最大的区别在于设计了一种每个核绑定一个线程,异步任务只在线程内执行,而不会在多线程之间传递。官方解释这种设计的好处在于,异步任务不需要在线程间传递,则不必设计为 Send + Sync,减轻了程序编写的负担。由于异步运行时多在重 I/ 阅读全文
posted @ 2025-05-02 12:57 kaleidopink 阅读(1) 评论(0) 推荐(0)
摘要: Linux 通过桥接网络可以模拟出两张网卡接入一个交换机的效果,从而实现两张网卡“融合”的效果,适合处理一台主机通过另一台双网卡连接到第三方的情况。 ┌────────────┐ │ 局域网 C │ │(192.168.1.x) └────┬───────┘ │ ┌───▼───┐ │ 交换机 │ 阅读全文
posted @ 2025-04-17 10:57 kaleidopink 阅读(8) 评论(0) 推荐(0)
摘要: 在 C 中使用 Rust 函数主要通过 Rust 构建动态库,然后 C 使用该动态库来实现。 构建动态库 ​ 首先要创建一个动态库项目,使用命令 cargo new hello --lib。 ​ 我们需要指明库类型为动态库,在 Cargo.toml 文件中添加 [lib] name = "hello 阅读全文
posted @ 2024-07-30 14:10 kaleidopink 阅读(99) 评论(0) 推荐(0)
摘要: C++ ECO 是一种对于空类型的内存布局优化策略. 在 C++ 中不允许存在大小为零的类型, 即便是空类也会占有一个字节的大小, 像 void 和没有定义的类型称为「非完备类型」(Incomplete Type). ​ 这带来一个问题, 如果将空类作为成员变量的类型, 则每个成员都会占用至少一个字 阅读全文
posted @ 2024-04-13 15:33 kaleidopink 阅读(25) 评论(0) 推荐(0)
摘要: 在C++中, 当new 操作符接受一个指针作为参数时, 表示在该指针所对应的地址上进行构建. new (ptr) Type(args...); 利用这一点, 我们可以在类的成员函数或者构造函数里对类进行重构: class Base { public: Base() { printf("default 阅读全文
posted @ 2024-01-31 13:27 kaleidopink 阅读(11) 评论(0) 推荐(0)
摘要: 本文中内容来自: Rust's Type System is Turing-Complete Smallfuck 语言 Smallfuck 是一门最小的图灵完备的编程语言, 其可以看成最基本的图灵机的一种变体, 其将计算机看成一条无限长的纸带, 纸带每一格存储 0 或 1, 存在一个指针指向纸带的某 阅读全文
posted @ 2024-01-08 13:53 kaleidopink 阅读(58) 评论(0) 推荐(0)
摘要: 1. Definitions ​ Definition 1. We say the process \(\{X(t),t\ge0\}\) is a continuous-time Markov chain if for all \(s,t\ge0\) and nonnegative integers 阅读全文
posted @ 2023-12-10 11:45 kaleidopink 阅读(54) 评论(0) 推荐(0)
摘要: 1. Introduction ​ Let \(\{X_n,n=0,1,2,...\}\) be a stochastic process that takes on a finite number of possible values. If \(X_n=i\), then the process 阅读全文
posted @ 2023-11-19 16:32 kaleidopink 阅读(138) 评论(0) 推荐(0)
摘要: 1. Basic properties and examples 1.1 Definitions ​ A function \(f:\R^n\rarr\R\) is convex if \(\mathrm{\textbf{dom}}\ f\) is a convex set and if for a 阅读全文
posted @ 2023-11-15 15:40 kaleidopink 阅读(44) 评论(0) 推荐(0)
摘要: 1. Counting process ​ We say that \(\{N(t),t\ge0\}\) is a counting process if \(N(t)\) represents the total number of "events" occur by time \(t\) and 阅读全文
posted @ 2023-11-14 17:22 kaleidopink 阅读(29) 评论(0) 推荐(0)