Interfacing D with C++ : start new thread

Interfacing D with C++ is sometime tricky. In this scenario, I will show how to start a thread from C++ that execute C++ code, but in a valid D environment, so that C++ code can interact with D code safely.

This work as been done to port SFML2 to D2 language. But the technique is useful for anybody who want to start safely thread in a environment with code in both C++ and D.

Continue reading