Lower bound for the maximum level of ownership for recursive_mutex?

扶醉桌前 提交于 2019-12-06 04:43:26

There is no lower limit specified in the standard. This is probably deliberate.

Older standards (C I think) did use to provide lower limits for things like this. The result was that people wrote coding standards which said you couldn't use more than these lower limits. For example: It was (and I think still is) implementation defined how many characters of an external symbol were significant when comparing for equality. So a_very_very_long_name_indeed_with_extra_padding and a_very_very_long_name_indeed_with_extra_paddingX might be treated as the same symbol. The minimum length was specified as 8, and coding standards were written specifying "maximum length of a external symbol is eight characters".

On the plausible lower bound for this value: I can easily imagine that the count might be bit-packed into some other field so that the whole thing can be updated atomically with a suitable instruction. As such, it might be a good deal less than 32 bits. (It only really needs to be large enough for the maximum call stack depths, so in a constrained environment, 31 might be good enough.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!