is d-runtime non-gc safe?

Sean Cavanaugh WorksOnMyMachine at gmail.com
Wed Dec 7 09:14:18 PST 2011


On 12/5/2011 3:22 PM, Norbert Nemec wrote:
> On 05.12.2011 21:40, Tobias Pankrath wrote:
>>> Right - thanks for the hint!
>>>
>>> That would leave the following rules for real-time audio code in D:
>>>
>>> [snip]
>>
>> What's about message passing? Is message passing hard real time ready?
>
> The issue actually came up for me a few weeks ago.
>
> In principle, all you need are non-blocking queues to send messages to,
> from or even between RT threads. With the atomic operations in D, such a
> queue is fairly straightforward to implement.
>
> Unfortunately, I could not find any OS support for non-blocking message
> passing. More specifically, there does not seem to be any way to wake a
> sleeping thread by sending a message from a RT thread. The only option
> is periodically querying the message queue. Not optimal, but probably
> sufficient for most purposes.
>

In windows land you would use MsgWaitForMultipleObject on the sleepy 
thread and wake it up with a kernel object of some kind (an Event most 
likely)


More information about the Digitalmars-d mailing list