C++0x thread interruption

后端 未结 8 1363
谎友^
谎友^ 2020-11-29 04:28

According to the C++0x final draft, there\'s no way to request a thread to terminate. That said, if required we need to implement a do-it-yourself solution.

On the o

8条回答
  •  情书的邮戳
    2020-11-29 05:08

    I agree with this decision. For example, .NET allows to abort any worker thread, and I never use this feature and don't recommend to do this to any professional programmer. I want to decide myself, when a worker thread may be interrupted, and what is the way to do this. It is different for hardware, I/O, UI and other threads. If thread may be stopped at any place, this may cause undefined program behavior with resource management, transactions etc.

提交回复
热议问题