Assuming I have a pool P1, that I know (1) is not used by any scheduler/xstream at the moment, (2) has no currently running ULT or task that could return to it upon yielding, and (3) will not be used as an argument to ABT_thread_create or other functions, i.e. ULTs that are in the pool are going to stay there and no new ULTs will be pushed or created in that pool.
I want to migrate the content of P1 to a pool P2 (which is in use by a scheduler/xstream, and has MPMC access). Is the following the right way of doing such a migration:
- Use
ABT_pool_get_size to get the number of ULTs in P1
- Use
ABT_pool_pop_threads to pop them all out of P1
- Use
ABT_pool_push_threads to push them to P2
In the above code, should I call ABT_thread_set_associated_pool before pushing the ULTs into P2?
I also see the function ABT_thread_migrate_to_pool. Can it be used to replace 3? I see in the documentation "Request a migration of a work unit to a specific pool.", but nothing about when this migration would happen. In the case of non-running ULTs, would this migration happen immediately?
Assuming I have a pool P1, that I know (1) is not used by any scheduler/xstream at the moment, (2) has no currently running ULT or task that could return to it upon yielding, and (3) will not be used as an argument to
ABT_thread_createor other functions, i.e. ULTs that are in the pool are going to stay there and no new ULTs will be pushed or created in that pool.I want to migrate the content of P1 to a pool P2 (which is in use by a scheduler/xstream, and has MPMC access). Is the following the right way of doing such a migration:
ABT_pool_get_sizeto get the number of ULTs in P1ABT_pool_pop_threadsto pop them all out of P1ABT_pool_push_threadsto push them to P2In the above code, should I call
ABT_thread_set_associated_poolbefore pushing the ULTs into P2?I also see the function
ABT_thread_migrate_to_pool. Can it be used to replace 3? I see in the documentation "Request a migration of a work unit to a specific pool.", but nothing about when this migration would happen. In the case of non-running ULTs, would this migration happen immediately?