gpt4 book ai didi

multithreading - 如何在没有竞争条件的情况下在 Qore 中启动新程序线程

转载 作者:行者123 更新时间:2023-12-01 12:19:03 24 4
gpt4 key购买 nike

我需要在新线程中启动程序。原始程序流得更远,pgm 变量在派生进程引用实例之前被销毁。添加 sleep 是暂时的。如何对其进行编码以避免竞争?

{
Program pgm = new Program(...);
...
background pgm.run();
sleep(1); # to avoid OBJECT-ALREADY-DELETED: attempt to access member 'pgm' of an already-deleted object of class 'DebugWrapper'
}

最佳答案

经过进一步审查,这个问题似乎是无效的(没有竞争条件)并且问题中的条件无法重现(也与提问者确认)。

原始答案中的问题也相应地被关闭为“不是错误”。

@TMa:你能撤回或取消这个问题吗?

关于multithreading - 如何在没有竞争条件的情况下在 Qore 中启动新程序线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45844653/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com