Is it possible to use a C multi-threaded lib with D (multi-threading)?

David d at dav1d.de
Sat Jan 12 09:32:21 PST 2013


> I understand that the ABI of D is C compatible, so I would expect that
> there shouldn't be any problems with threading as well.

D uses pthread for core.Thread and core.sync.*

> Can I somehow
> use D's threading features in combination with the libraries C features?
> Or is it better to completely keep the two seperate?

I wouldn't mix core.Thread/std.parallelism/std.concurrency with C
threading. Like calling a core.Thread.Thread from a threaded c callback,
but it might even work.


> Has anyone any experience in mixing D and C in multi-threaded envrionments?

I used std.parallelism together with stb_image.c to load images
concurrently into memory, worked very well!



More information about the Digitalmars-d mailing list