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

Robert M. Münch robert.muench at saphirion.com
Sat Jan 12 11:28:50 PST 2013


On 2013-01-12 17:32:21 +0000, David said:

>> 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.*

On all platforms?

> I wouldn't mix core.Thread/std.parallelism/std.concurrency with C
> threading.

Ok.

> Like calling a core.Thread.Thread from a threaded c callback,
> but it might even work.

Maybe I just need to give it a try.

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

Just to be sure that I understand this right. The C part is not 
multi-threaded in your case, right? So, you used D's threading in 
combination with some C code.

-- 
Robert M. Münch
Saphirion AG

http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d mailing list