On Wednesday, 18 June 2014 at 02:35:03 UTC, Ali Çehreli wrote:
Without any experience on this topic, I suspect this is what
you need:
http://dlang.org/phobos/core_thread.html#.thread_attachThis
Ali
That was exactly what I needed. Thanks.
So, me and my threads again :)
I have some threads being created by libuv using start_thread()
from libpthread calling into D code. D code (after some help from
this forum) has been properly shared and when called from D
threads and tasks works correctly. However when called by libuv
from out
On Tuesday, 17 June 2014 at 17:18:36 UTC, Ali Çehreli wrote:
Shared data can be accessed by more than one thread. Unless it
is locked, other threads may see the array in an inconsistent
state.
Ali
But that's a local copy of it, no? If it's not, will making a
local copy solve this?
The origi
Does making an array copy with shared cast away make any sense?
auto n = 10;
auto sharedData = new shared SomeClass[n];
foreach (i; 0..n) sharedData[i] = new shared SomeClass(i);
auto nonSharedData = cast(SomeClass[]) sharedData[0..$];
auto sorted = sort!((a, b) => a.value < b.value)(nonSharedDa
On Tuesday, 17 June 2014 at 04:38:24 UTC, Ali Çehreli wrote:
Good news: The code compiles with 2.066 after adding 'import
std.algorithm;' :)
Ali
Thanks, but where can I get 2.066? It seems it's not going to be
branched until June 30th.
Is there any way to resolve this now with 2.065?
I'm trying to sort shared data with a predicate. Buy that causes
'unable to format shared objects'. Here's an example reproducing
the issue without any threading code:
shared class SomeClass {
immutable int value;
this(const int value) {
this.value = value;
}
}
void main() {
I have a Node.js module written in D and exposed through C++
interface. I'd like to implement a proper async API which is
pretty straightforward using libuv in the C++ glue part. On the D
side I have a data structure that's build once and then queried
from Node (possibly torn down and rebuild l
On Friday, 6 June 2014 at 02:13:08 UTC, Ellery Newcomer wrote:
On Thursday, 5 June 2014 at 18:51:25 UTC, George Sapkin wrote:
I'm trying to link a simple D static library to C code, but
I'm can't figure out how to do it properly without getting a
segfault when running it.
try this:
dmd -lib
On Friday, 6 June 2014 at 02:01:12 UTC, Mark Isaacson wrote:
I found that if I told dmd rather than gcc to do the linking
that
everything just magically worked.
In other words:
gcc -c cstuff.c
dmd -c dstuff.d
dmd cstuff.o dstuff.o
I presume that dmd would be similarly smart with static
librar
On Thursday, 5 June 2014 at 19:14:34 UTC, Stefan Koch wrote:
On Thursday, 5 June 2014 at 19:00:24 UTC, George Sapkin wrote:
On Thursday, 5 June 2014 at 18:55:13 UTC, Stefan Koch wrote:
You need to link the druntime too, I think.
At which stage? Can you provide a full command? Thanks.
Err ..
On Thursday, 5 June 2014 at 19:14:34 UTC, Stefan Koch wrote:
On Thursday, 5 June 2014 at 19:00:24 UTC, George Sapkin wrote:
On Thursday, 5 June 2014 at 18:55:13 UTC, Stefan Koch wrote:
You need to link the druntime too, I think.
At which stage? Can you provide a full command? Thanks.
Err ..
On Thursday, 5 June 2014 at 19:10:17 UTC, Dave Wilson wrote:
You can create a static library from one or more .o files using
ar, if that helps (unless I've failed to understand the
question). "ar r libtest.a test.o" should do the job.
I don't have trouble creating a static library with dmd, I
On Thursday, 5 June 2014 at 18:55:13 UTC, Stefan Koch wrote:
You need to link the druntime too, I think.
At which stage? Can you provide a full command? Thanks.
I'm trying to link a simple D static library to C code, but I'm
can't figure out how to do it properly without getting a segfault
when running it.
test.d
---
import std.stdio;
extern(C) void funcD() {
writeln("From D");
}
main.c
---
14 matches
Mail list logo