How you guys go about -BetterC Multithreading?

rikki cattermole rikki at cattermole.co.nz
Thu Nov 9 12:30:49 UTC 2017


On 09/11/2017 12:19 PM, Petar Kirov [ZombineDev] wrote:
> On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote:
>> Any experience reports or general suggestions?
>> I've used only D threads so far.
> 
> It would be far easier if you use druntime + @nogc and/or de-register 
> latency-sensitive threads from druntime [1], so they're not interrupted 
> even if some other thread calls the GC. Probably the path of least 
> resistance is to call [2] and queue @nogc tasks on [3].
> 
> If you really want to pursue the version(D_BetterC) route, then you're 
> essentially on your own to use the threading facilities provided by your 
> target OS, e.g.:
> 
> https://linux.die.net/man/3/pthread_create
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms682516(v=vs.85).aspx 

You can use a library like libuv to handle threads (non-language based 
TLS too, not sure that it can be tied in unfortunately).


More information about the Digitalmars-d-learn mailing list