I got the OK to submit the D library to Eclipse Paho. So,
hopefully within the next few weeks there will be a Paho
incubator project for the D language client.
On Wednesday, 22 July 2015 at 09:04:49 UTC, Marc Schütz wrote:
But as long as the original pointer is still on the stack, that
one _will_ keep the object alive. It is only a problem if all
pointers to a GC managed object are stored in places the GC
isn't informed about.
Sorry, I have
On Sunday, 19 July 2015 at 17:12:07 UTC, rsw0x wrote:
a pointer to a pointer(or in this case, a reference) does not
keep it alive.
Interesting. If you de-reference the pointer and assign it back,
do you get back the keep-alive? Like, in the receiving thread:
void threadFunc()
{
On Friday, 24 July 2015 at 18:02:58 UTC, Ali Çehreli wrote:
Although the example casts to void*, ubyte* and others are
possible as well, and casting back to the correct class type
seems to work:
Thanks, Ali.
I just tried a few things, and apparently, you don't need to go
to a different type
On Friday, 24 July 2015 at 19:28:35 UTC, anonymous wrote:
I haven't followed the discussion, so I may be missing the
point here.
I started by asking how to send a reference to an immutable class
object from one thread to another if the reference is one of
several parameters being sent. The
On Thursday, 23 July 2015 at 09:05:12 UTC, Marc Schütz wrote:
It is not safe, but for a different reason: `mt` is already a
_reference_ to the actual object (that's how classes behave in
D). This reference is located in a register or on the stack,
and `mt` is therefore a pointer into the
Hey All,
I'm trying to send immutable class objects to a thread, and am
having trouble if the object is one of several variables sent to
the thread. For example, I have a Message class:
class Message { ... }
and I create an immutable object from it, and send it to another
thread:
OK, I found a couple of solutions, though if anyone can tell me
something better, I would love to hear it.
By making an alias to a rebindable reference, the receive() was
able to create the tuple. So I renamed the class MessageType:
class MessageType { ... };
and then made a Message an
It looks like passing a pointer to an immutable(Message) works
as well:
Oh, yes, pointer. Ha! I didn't even think of that. Thanks.
I'm not familiar with how garbage collection works in D. If the
initial reference goes out of scope, and you just have a pointer
- in another thread, no less -