digitalmars.D.learn - get os thread handles
- Sean Campbell (2/2) Jul 20 2014 How do i get an os thread handle from a thread object.
- Jonathan M Davis (6/8) Jul 20 2014 They do wrap OS threads, but they encapsulate them in a
- Sean Campbell (2/10) Jul 20 2014 sonce the standard so i can get pause/resume support for d threads
- Jonathan M Davis (18/31) Jul 20 2014 I'd suggest opening up an enhancement request. Assuming that that
How do i get an os thread handle from a thread object. or are d thread not wrapped os threads.
Jul 20 2014
On Sunday, 20 July 2014 at 09:34:46 UTC, Sean Campbell wrote:How do i get an os thread handle from a thread object. or are d thread not wrapped os threads.They do wrap OS threads, but they encapsulate them in a cross-platform manner, and looking over Thread, it doesn't look like anything along the lines of an OS thread handle is exposed in the API. What do you need the OS thread handle for?
Jul 20 2014
On Sunday, 20 July 2014 at 09:53:52 UTC, Jonathan M Davis wrote:On Sunday, 20 July 2014 at 09:34:46 UTC, Sean Campbell wrote:sonce the standard so i can get pause/resume support for d threadsHow do i get an os thread handle from a thread object. or are d thread not wrapped os threads.They do wrap OS threads, but they encapsulate them in a cross-platform manner, and looking over Thread, it doesn't look like anything along the lines of an OS thread handle is exposed in the API. What do you need the OS thread handle for?
Jul 20 2014
On Sunday, 20 July 2014 at 10:03:47 UTC, Sean Campbell wrote:On Sunday, 20 July 2014 at 09:53:52 UTC, Jonathan M Davis wrote:I'd suggest opening up an enhancement request. Assuming that that functionality exists across all of the various OSes, it can probably be added: https://issues.dlang.org You can also open an enhancement request for getting access to the OS thread handles, but my guess is that that wouldn't happen, because it makes it so that the Thread class no longer has full control, which would make it impossible to have any kind of safety for Thread (though it doesn't seem to currently have any such annotations). But if what you're looking for is thread functionality that is common across OSes, then there's a good chance that it's reasonable to add it to Thread, making it unnecessary to provide access to its innards. In the meantime, I expect that you'll have to either use the C APIs directly or create your own class which is a copy of Thread and tweak it to do what you need.On Sunday, 20 July 2014 at 09:34:46 UTC, Sean Campbell wrote:sonce the standard so i can get pause/resume support for d threadsHow do i get an os thread handle from a thread object. or are d thread not wrapped os threads.They do wrap OS threads, but they encapsulate them in a cross-platform manner, and looking over Thread, it doesn't look like anything along the lines of an OS thread handle is exposed in the API. What do you need the OS thread handle for?
Jul 20 2014