【python】RuntimeError: Lock objects should only be shared b
发布时间:2020-12-17 01:23:03 所属栏目:Python 来源:网络整理
导读:p style="color:rgb(85,85,85);font-family:'microsoft yahei';font-size:15px;"span style="font-family:'Microsoft YaHei';font-size:14px;"转自:http://blog.csdn.net/moxiaomomo/article/details/11470157 p style="color:rgb(85,85);font-family:'micr
<p style="color:rgb(85,85,85);font-family:'microsoft yahei';font-size:15px;"><span style="font-family:'Microsoft YaHei';font-size:14px;">转自:http://blog.csdn.net/moxiaomomo/article/details/11470157 <p style="color:rgb(85,85);font-family:'microsoft yahei';font-size:15px;"><span style="font-family:'Microsoft YaHei';font-size:14px;"><p style="color:rgb(85,85);font-family:'microsoft yahei';font-size:15px;"><span style="font-family:'Microsoft YaHei';font-size:14px;">在使用multiprocessing模块时,使用了同步锁Lock,结果出现了如下错误:<p style="color:rgb(85,85);font-family:'microsoft yahei';font-size:15px;"><span style="font-family:'Microsoft YaHei';font-size:14px;"><span style="color:rgb(255,0);">RuntimeError: Lock objects should only be shared between processes through inheritance <p style="color:rgb(85,85);font-family:'microsoft yahei';font-size:15px;"><span style="font-family:'Microsoft YaHei';font-size:14px;">我本来是这样用的:<p style="color:rgb(85,85);font-family:'microsoft yahei';font-size:15px;"><div class="dp-highlighter bg_python" style="font-family:Consolas,'Courier New',Courier,mono,serif;background-color:rgb(231,229,220);overflow:hidden;border-color:rgb(204,204,204);color:rgb(85,85);"><div class="bar"><div class="tools" style="font-size:9px;line-height:normal;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;color:#C0C0C0;background-color:rgb(248,248,248);border-left:3px solid rgb(108,226,108);border-right:1px solid rgb(231,220);">[python]?<a href="http://blog.csdn.net/moxiaomomo/article/details/11470157#" rel="nofollow" class="ViewSource" title="view plain" style="background-image:url("images/default/ico_plain.gif");background-position:left top;background-repeat:no-repeat;background-color:inherit;border:none;color:rgb(12,137,207);display:inline-block;width:16px;text-indent:-2000px;">view plain?<a href="http://blog.csdn.net/moxiaomomo/article/details/11470157#" rel="nofollow" class="CopyToClipboard" title="copy" style="background-image:url("images/default/ico_copy.gif");background-position:left top;background-repeat:no-repeat;background-color:inherit;border:none;color:rgb(12,207);display:inline-block;width:16px;text-indent:-2000px;">copy<div style="width:18px;z-index:99;"> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |