[argobots-discuss] ABT_thread_yield_to() semantics when crossing pools

Carns, Philip H. carns at mcs.anl.gov
Thu Aug 13 14:10:19 CDT 2020


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/0aa62389/attachment.html>


More information about the discuss mailing list