... def run(self):#运行一个线程 thread = WorkerThread(self.count, self)#创建一个线程 thread.start()#启动线程 ...
基于8个网页-相关网页
即使只运行一个线程,崩溃版的速度也要快约30%:获取您已占用的锁比获取无人占用的锁要快得多。
Even when run with a single thread, the collapsed version was some 30 percent faster: it is much faster to acquire a lock that you already hold than one that nobody holds.
在libspe2中,这个操作变成同步的了,因此您可能会希望在后台运行一个线程,并发出自己的pthread调用。
In libspe2, the operation is synchronous, so if you want to run a thread in the background, you have to make your own pthread calls.
当一个线程在运行的时候,不管是上传还是下载,你可以查询进程状态并且给用户一个反馈(例如一个进度条)。
While a thread is running, either uploading or downloading, you can query it to check on its status to provide the user with feedback (e.g. a progress bar).
应用推荐