Sending crtl+c to python process result in running full cpu-usage?
12 views
Skip to first unread message
Hongxin Song
unread,
Feb 24, 2018, 3:07:05 AM2/24/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython-users
Dear all!
I want to use multithreading module to study GIL performance in python version of 2.7.6 and CentOS6 system installed glibc-2.12, that have 32 cores. Then I make 8 python child threads run, then the cpu usage is near to 300%, but when I send crtl+c to process, the cpu usage is near to 800%. Why ? The codes as follow:
#coding=utf-8 import threading def thread_tt(t): whileTrue: pass for x in xrange(0,8): t = threading.Thread(target=thread_tt, args=(5,)) t.start()
I think 300% cpu-usage result from one thread calls sem_post ,and one more thread call sem_wait frequently. But, 800% cpu-usage looks like every thread call sem_post and sem_wait at the same.