… | |
… | |
3188 | parallel from multiple threads, calls with the same loop parameter must be |
3188 | parallel from multiple threads, calls with the same loop parameter must be |
3189 | done serially (but can be done from different threads, as long as only one |
3189 | done serially (but can be done from different threads, as long as only one |
3190 | thread ever is inside a call at any point in time, e.g. by using a mutex |
3190 | thread ever is inside a call at any point in time, e.g. by using a mutex |
3191 | per loop). |
3191 | per loop). |
3192 | |
3192 | |
3193 | If you want to know which design is best for your problem, then I cannot |
3193 | If you want to know which design (one loop, locking, or multiple loops |
3194 | help you but by giving some generic advice: |
3194 | without or something else still) is best for your problem, then I cannot |
|
|
3195 | help you. I can give some generic advice however: |
3195 | |
3196 | |
3196 | =over 4 |
3197 | =over 4 |
3197 | |
3198 | |
3198 | =item * most applications have a main thread: use the default libev loop |
3199 | =item * most applications have a main thread: use the default libev loop |
3199 | in that thread, or create a separate thread running only the default loop. |
3200 | in that thread, or create a separate thread running only the default loop. |