Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rCore-Tutorial-Guide-2025S/chapter4/6multitasking-based-on-as #4

Open
utterances-bot opened this issue Feb 25, 2025 · 1 comment
Open

Comments

@utterances-bot
Copy link

基于地址空间的分时多任务 - rCore-Tutorial-Guide-2025S 文档

https://learningos.cn/rCore-Tutorial-Guide-2025S/chapter4/6multitasking-based-on-as.html

Copy link

sswybd commented Feb 25, 2025

KERNEL_SPACE: Arc<UPSafeCell<MemorySet>> 是否合适?根据 https://doc.rust-lang.org/std/sync/struct.Arc.html#thread-safetyArcT 应该实现了 Sync Trait。虽然 UPSafeCell 强行实现了 Sync,但是内部其实是 !SyncRefCell, 链接的文档中就比较明确地写了应用 RwLock 而不是 RefCell. 按照仓库文档的写法

impl<T> UPSafeCell<T> {
    /// User is responsible to guarantee that inner struct is only used in
    /// uniprocessor.
...

依然没有保证使用单线程,而是要求保证使用单处理器。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants