E D R , A S I H C RSS

Python Multi Threading

Python ��는 2���� thread interface 를 ���. 는 C ���� API 를, 는 Java ���� Thread Object를.

����는 방�� 매�� �. Thread class 를 ����받�뒤 Java 럼 start 메�����면 run 메����� ����� multithread � ����.

�.
~cpp 
import thread
import time

def runOne(args):
	i = 0
	while(1):
		i = i+1
		print "thread : ", i, args
		time.sleep(1)


if __name__=="__main__":
	thread.start_new_thread(runOne, ((1,)))

	for i in range(100000,0,-1):
		print "waiting: ", i
		time.sleep(1)

�른 ���� �����Seminar:LightWeightThreads�� ����.
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:24:08
Processing time 0.0115 sec