Pausing a thread using threading class

后端 未结 6 1452
情歌与酒
情歌与酒 2020-12-08 07:41

I have a long process that i\'ve scheduled to run in a thread, because otherwise it will freeze the ui in my wxpython application.

I\'m using

thread         


        
6条回答
  •  悲&欢浪女
    2020-12-08 08:30

    You might take a look at the Windows API for thread suspension.

    As far as I'm aware there is no POSIX/pthread equivalent. Furthermore, I cannot ascertain if thread handles/IDs are made available from Python. There are also potential issues with Python, as its scheduling is done using the native scheduler, it's unlikely that it is expecting threads to suspend, particularly if threads suspended while holding the GIL, amongst other possibilities.

提交回复
热议问题