Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
October 06, 2019 Needs pause intrinsic/wrapper in druntime, but where? | ||||
---|---|---|---|---|
| ||||
I need a pause() function in druntime (wrap x86 `pause`/arm `yield`, etc), but it's not clear where to put it... Candidates are: core.atomic - seems odd, but it's almost exclusively used when implementing spin locks core.thread - sounds appropriate, but doesn't really mean anything wrt threads core.sync.??? - no appropriate sub-package appears to exist... Ideas? I'm leaning towards core.atomic. |
October 06, 2019 Re: Needs pause intrinsic/wrapper in druntime, but where? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Sunday, 6 October 2019 at 18:50:56 UTC, Manu wrote:
> I need a pause() function in druntime (wrap x86 `pause`/arm `yield`,
> etc), but it's not clear where to put it...
> Candidates are:
> core.atomic - seems odd, but it's almost exclusively used when
> implementing spin locks
> core.thread - sounds appropriate, but doesn't really mean anything wrt threads
> core.sync.??? - no appropriate sub-package appears to exist...
>
> Ideas?
> I'm leaning towards core.atomic.
intrinsics go into core.bitOp
Atomic Load and Store are there as well :)
|
October 06, 2019 Re: Needs pause intrinsic/wrapper in druntime, but where? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | On Sunday, 6 October 2019 at 21:17:16 UTC, Stefan Koch wrote:
> intrinsics go into core.bitOp
pause has nothing to do with bits though...
|
October 06, 2019 Re: Needs pause intrinsic/wrapper in druntime, but where? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Sunday, 6 October 2019 at 21:36:49 UTC, Adam D. Ruppe wrote:
> On Sunday, 6 October 2019 at 21:17:16 UTC, Stefan Koch wrote:
>> intrinsics go into core.bitOp
>
> pause has nothing to do with bits though...
neither does atomic load and store.
or writing to input/output ports.
|
October 06, 2019 Re: Needs pause intrinsic/wrapper in druntime, but where? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | On Sun, Oct 6, 2019 at 2:50 PM Stefan Koch via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Sunday, 6 October 2019 at 21:36:49 UTC, Adam D. Ruppe wrote:
> > On Sunday, 6 October 2019 at 21:17:16 UTC, Stefan Koch wrote:
> >> intrinsics go into core.bitOp
> >
> > pause has nothing to do with bits though...
>
> neither does atomic load and store.
>
> or writing to input/output ports.
Too late the party, it's in core.atomic. I reckon that's the most sensible location.
|
Copyright © 1999-2021 by the D Language Foundation