ç¾½æ ¹æ¨å ¬åã¸æ¢ ãè¦ã«è¡ã ã©ããæ¢ ãè¦ã«è¡ããããã©ãã¾ã è¡ã£ããã¨ãªããã¨ããªãããªãã¨æã£ã¦ããTwitterã«æµãã¦ããï¼ ç¥ä»£æ¤ç©å ¬åãå¾ã«ããã次ã¯ç¾½æ ¹æ¨å ¬åã¸ããã¡ããæ¢ ã¾ã¤ãéå¬ä¸ã§ããã¤ãã³ããã§ãã«ã¼è£½ä½å§å¡ä¼@event_checker ããã§è¦ããã¦å訪åãä»ã¾ã§ç¥ããªãã£ãâ¦
çµç·¯ æè¿æ¸ãã¦ããããã°ã©ã ã§ç¡éã«ã¼ãããã¯ã¼ã«ã¼ã¹ã¬ãããç«ã¦ã¾ãããã®ããã£ã¦, ããã 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ãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}