On Thursday, 9 November 2017 at 12:43:54 UTC, Petar Kirov [ZombineDev] wrote:
On Thursday, 9 November 2017 at 12:30:49 UTC, rikki cattermole wrote:
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).

Yeah, any cross-platform thread-pool / event loop library with C interface should obviously be preferred than manual use of raw thread primitives.

Essentially, try to follow Sean Parent's advice on "No Raw/Incidental *":
https://www.youtube.com/watch?v=zULU6Hhp42w

This all is good input, thanks.
I was looking into:
https://github.com/GerHobbelt/pthread-win32

Anyone used this?

Reply via email to