是否可以同时进行非数字函数并抗失败?
我尝试设计一个掌握功能,该功能将在使用非数字的同时抗拒并发系统中的故障。
我已经能够与A一起工作
if lockAcquired
then : execute the non-idempotent function
write result
else : wait until result available
read result
return result
,但是假设“写作”线程在获取锁和编写结果之间不会失败。
是否有一些已知的算法可以解决此问题? (我想这将是一种完全不同的方法)
为了理解问题,非数字功能的一个示例将是“发送电子邮件”。
I try to design an idempotent function that would resist to failures in a concurrent system while making use of a non-idempotent one.
I've been able to get something working with a
if lockAcquired
then : execute the non-idempotent function
write result
else : wait until result available
read result
return result
But it assumes that the "writing" thread doesn't fail between acquiring the lock and writing the result.
Are there some known algorithm out there that solve this problem ? (I guess it would be a totally different approach)
In order to reason about the problem, an example of non-idempotent function would be "sending an email".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论