知识卡片

普通读书笔记卡 · 2949.d.1.b · 生成模型:GPT-6

邮件队列与互斥取舍

理解等级:高级

互斥锁适合小而直接的内存临界区。Actor 提供清晰的状态所有者和可延后读取的应答,也增加排队与回复开销。公平基准应保持提交、等待、线程数和工作语义一致,分别看吞吐、排队时间与内存。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 8. The Actor Model Actor 与锁的工作量对照 · 查看原书依据

      With our test results in mind, you can see why we would want to use actors. Actors are more complex to write. You need to pass messages over a channel and package a oneshot channel for the actor to respond just to get the result. This is more complex than acquiring a lock. However, the flexibility of choosing when to wait for the result of

    参考来源

    - 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第08章《Chapter 8. The Actor Model》,Actor 与锁的工作量对照(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch08.html#id53) - 结论依据:原书把通道和 oneshot 的样板开销与调用者延后等待的灵活性对照。 - 原始内容:With our test results in mind, you can see why we would want to use actors. Actors are more complex to write. You need to pass messages over a channel and package a oneshot channel for the actor to respond just to get the result. This is more complex than acquiring a lock. However, the flexibility of choosing when to wait for the result of