[argobots-discuss] ABT_thread_yield_to() semantics when crossing pools
Carns, Philip H.
carns at mcs.anl.gov
Thu Aug 13 15:06:23 CDT 2020
Ok, got it- thanks!
-Phil
________________________________
From: Iwasaki, Shintaro <siwasaki at anl.gov>
Sent: Thursday, August 13, 2020 3:33 PM
To: Carns, Philip H. <carns at mcs.anl.gov>; discuss at lists.argobots.org <discuss at lists.argobots.org>
Subject: Re: ABT_thread_yield_to() semantics when crossing pools
Hi Phil,
Sorry, it was very confusing. Let's say the current thread (Tc) and the target thread (Tt).
Tc is running on the current ES. Tt must be sleeping in a pool.
- The target thread (Tt) is removed from Tt's pool. If failed (e.g., Tt is being executed by another ES), it causes undefined behavior (NO ERROR CHECK).
- The current thread (Tc) suspends and is pushed to Tc's pool.
- After suspending Tc, the current ES/scheduler executes Tt.
At any rate, does the target thread run on the ES that was previously executing the thread that called yield_to()?
Yes.
Thanks,
Shintaro
________________________________
From: Carns, Philip H. <carns at mcs.anl.gov>
Sent: Thursday, August 13, 2020 2:10 PM
To: Iwasaki, Shintaro <siwasaki at anl.gov>; discuss at lists.argobots.org <discuss at lists.argobots.org>
Subject: Re: ABT_thread_yield_to() semantics when crossing pools
Can you define what the yielded thread (Ty) and current thread (Tc) are?
Naively I would think that the current thread is the one invoking ABT_thread_yield_to(), but that also means that it is the yielded thread as well 🙂
At any rate, does the target thread run on the ES that was previously executing the thread that called yield_to()?
thanks,
-Phil
________________________________
From: Iwasaki, Shintaro <siwasaki at anl.gov>
Sent: Wednesday, August 12, 2020 11:31 AM
To: discuss at lists.argobots.org <discuss at lists.argobots.org>
Cc: Carns, Philip H. <carns at mcs.anl.gov>
Subject: Re: ABT_thread_yield_to() semantics when crossing pools
Hi Phil,
This is not explicitly mentioned, but ABT_thread_yield_to() works as follows:
- The yielded thread (Ty) is removed from Ty's pool. If failed (e.g., Ty is being executed by another ES), it causes an undefined behavior (NO ERROR CHECK).
- The current thread (Tc) suspends and is pushed to Tc's pool.
So unless the target thread is "ready" in the pool (i.e., not running, not completed), there is no problem.
It should work even if Ty and Tc are in separate or customized pools.
(This "NO ERROR CHECK" part cannot be easily fixed because of the current ABT_pool_remove() specification.
If you want to use this feature with an error check, please tell us (or create a GitHub issue) so that we can fix it.)
Thanks,
Shintaro Iwasaki
________________________________
From: Carns, Philip H. via discuss <discuss at lists.argobots.org>
Sent: Wednesday, August 12, 2020 9:56 AM
To: discuss at lists.argobots.org <discuss at lists.argobots.org>
Cc: Carns, Philip H. <carns at mcs.anl.gov>
Subject: [argobots-discuss] ABT_thread_yield_to() semantics when crossing pools
Hi,
I was just curious: what happens if you create a thread on a separate pool (with it's own execution streams) and then call ABT_thread_yield_to()?
Nothing? Error? Or maybe it pulls the ULT back to the local execution stream?
thanks!
-Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.argobots.org/pipermail/discuss/attachments/20200813/efeeb884/attachment.html>
More information about the discuss
mailing list