Running multiple concurrent GMainLoops

前端 未结 1 782
我在风中等你
我在风中等你 2021-02-01 07:20

Are users of GLib allowed to run multiple GMainLoop instances concurrently in multiple threads, with each thread running its own instance? I\'ve found \"yes\" and

相关标签:
1条回答
  • 2021-02-01 08:04

    The book "Foundations of GTK+ Development" states this:

    The GLib main loop is implemented as a number of structures, which allow multiple instances to be run concurrently.

    So, given this, my test code, and the link I posted in the comment above we have a definitive answer to this question.

    Namely: Multiple threads may have their own GMainContext & GMainLoop, and are able to independently run these loops in a concurrent fashion.

    0 讨论(0)
提交回复
热议问题