Other Concurrency Issues

Synchronization is a fundamentally difficult problem that raises issues that simply do not arise in ordinary sequential programs.

Thread  safety issues:
1.Functions that do not protect shared variables.
2.Functions that keep state across multiple invocations.
3.Functions that return a pointer to a static variable
4. Functions that call thread-unsafe functions.

Reentrancy issues:

Reentrancy functions are typically more efficient than nonreentrant thread-safe functions because they no synchronization operations.

If all function arguments are passed by value and all data references are to local automatic stack variable,then the function is explicitly reentrant.

If we loosen our assumptions a bit and allow same parameters in our otherwise explicitly reentrant function to be passed by reference then we have an implicitly reentrant function.

It's important to realize that reentrancy is sometimes a property of both the caller and the callee, and not just the callee alone.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值