経緯 最近書いているプログラムで無限ループするワーカースレッドを立てまくるものがあって, それを signal で安全に終了させる手段が知りたかった. 課題プログラム 以下のようなプログラムがあります. import threading import time def loopfunc(event): print "Thread Started" while not event.isSet(): time.sleep(1) print "Thread End" def main() : threads = [] e = threading.Event() for x in range(10): threads.append(threading.Thread(target=loopfunc, args=(e,))) threads[x].start() for th in threads:
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く