简体   繁体   English

有关nftw()和ftw()的线程安全性的问题

[英]Questions about thread-safety of nftw() and ftw()

I read two man pages( ftw , nftw ) from opengroup.org, so I thought ftw() and nftw() do not guarantee thread-safety. 我从opengroup.org读了两个手册页( ftwnftw ),所以我认为ftw()nftw()不能保证线程安全。

But I've found another page about these functions from man7.org, which says ftw() is MT-safe and nftw() is MT-safe cwd . 但是我在man7.org上找到了有关这些功能的另一 ,其中说ftw()是MT安全的, nftw()MT-safe cwd

And these functions are in thread-safety exception list, in this page . 这些功能在此页的线程安全异常列表中。

For now, I still believe these functions don't guarantee thread-safety. 目前,我仍然相信这些功能不能保证线程安全。 But I wonder why does this say ftw() is MT-safe. 但我不知道为什么这样ftw()是线程安全的。

Why does the page from man7.org say ftw() is MT-safe? 为什么man7.org的页面上说ftw()是MT安全的?

Is it based on POSIX standard? 它基于POSIX标准吗?

The fact that POSIX says a function is not multithread-safe only means "it is not guaranteed to be multithread-safe", so you cannot expect it to be or rely that it is. POSIX表示函数不是多线程安全的事实仅意味着“不能保证它是多线程安全的”,因此您不能指望它是或不是它。 However, it does not mean that it is forbidden for implementations to make it multithread-safe. 但是,这并不意味着禁止其实现多线程安全。 Implementations may always apply stronger guarantees than the standard requires, they just must not apply weaker ones. 实施可能总是应用比标准要求更强的保证,只是不能应用较弱的保证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM