4
주 프로그램에서 PyV8을 사용하면 좋습니다.
는하지만 1 실 (주요하지 프로그램 자체 만 1 개 추가 스레드)PyV8 - 어떻게 작동하게하려면?
class TaskThread(threading.Thread):
def __init__(self, task):
threading.Thread.__init__(self)
self.task = task
def run(self):
try:
self.task.run()
except Exception as e:
pass
이 코드가 한 줄 self.task.run()
에서 실행할 경우에도 :
context = PyV8.JSContext(self.window) # <- this stops everything
전체를 정지 프로그램.
나는 PyV8이 "쓰레기를 좋아하지 않는다"는 것을 이미 알았지 만 어떻게 쓰레드 작업을 할 수 있을까?
t = YourThreadClass()
t.daemon = True
t.start()
그냥이 방법으로 그것을 시작 :
새 스레드에서 컨텍스트를 만들 때만 스레드를 시작할 때 라커를 잠글 필요가없는 것처럼 보입니다. – Claudiu