Re: Why is amap implemented as a member function of TaskPool?

2014-09-22 Thread Atila Neves via Digitalmars-d-learn
On Saturday, 20 September 2014 at 07:25:45 UTC, Russel Winder via Digitalmars-d-learn wrote: On Sat, 2014-09-20 at 06:46 +, "Nordlöw" via Digitalmars-d-learn wrote: On Thursday, 18 September 2014 at 19:49:00 UTC, Atila Neves wrote: > I had to roll my own parallel map today, but at least I d

Re: Why is amap implemented as a member function of TaskPool?

2014-09-22 Thread Atila Neves via Digitalmars-d-learn
On Saturday, 20 September 2014 at 06:46:43 UTC, Nordlöw wrote: On Thursday, 18 September 2014 at 19:49:00 UTC, Atila Neves wrote: I had to roll my own parallel map today, but at least I did get a nice 3x speedup. Is your own parallel map public somewhere? It would be interesting to see it.

Re: put string[] into a appender without loop?

2014-09-22 Thread monarch_dodra via Digitalmars-d-learn
On Sunday, 21 September 2014 at 23:50:50 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Sun, Sep 21, 2014 at 11:41:56PM +, AsmMan via Digitalmars-d-learn wrote: I'd like to copy an array string into a appender!string() but I can't see how to do this without loop myself over the string arr

parallel foreach hangs

2014-09-22 Thread Daniel Kozak via Digitalmars-d-learn
this code never end import std.stdio; import std.file; import std.parallelism : parallel; import std.algorithm : filter; void main(string[] args) { foreach(d; parallel(args[1 .. $], 1)) { auto phpFiles = filter!`endsWith(a.name,".php")`(dirEntries(d,SpanMode.depth)); wr

Re: How does GC.addRange work?

2014-09-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/21/14 3:00 PM, Gary Willoughby wrote: On Saturday, 20 September 2014 at 23:08:08 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 20 Sep 2014 22:21:13 + Gary Willoughby via Digitalmars-d-learn wrote: So zeroing values will inform the GC the reference has gone? yes. Thanks, i jus

Re: how to create and compile reesources for dmd 64

2014-09-22 Thread Kagamin via Digitalmars-d-learn
You probably compile resource to compiled resource format. If you compile it to coff, linker should accept it.

Re: parallel foreach hangs

2014-09-22 Thread anonymous via Digitalmars-d-learn
On Monday, 22 September 2014 at 11:25:53 UTC, Daniel Kozak wrote: this code never end import std.stdio; import std.file; import std.parallelism : parallel; import std.algorithm : filter; void main(string[] args) { foreach(d; parallel(args[1 .. $], 1)) { auto phpFiles = filter!`

Cannot deduce from type

2014-09-22 Thread Chris via Digitalmars-d-learn
Why is that? import std.stdio, std.array void main() { auto output = appender!(string); output ~= "world!"; // output.data.insertInPlace(0, "Hello, "); // Doesn't work auto asString = output.data; asString.insertInPlace(0, "Hello, "); // Works writeln(asString); // prints "Hello, w

Re: Cannot deduce from type

2014-09-22 Thread anonymous via Digitalmars-d-learn
On Monday, 22 September 2014 at 14:45:31 UTC, Chris wrote: Why is that? import std.stdio, std.array void main() { auto output = appender!(string); output ~= "world!"; // output.data.insertInPlace(0, "Hello, "); // Doesn't work auto asString = output.data; asString.insertInPlace(0, "He

Re: Cannot deduce from type

2014-09-22 Thread Chris via Digitalmars-d-learn
On Monday, 22 September 2014 at 15:00:09 UTC, anonymous wrote: On Monday, 22 September 2014 at 14:45:31 UTC, Chris wrote: Why is that? import std.stdio, std.array void main() { auto output = appender!(string); output ~= "world!"; // output.data.insertInPlace(0, "Hello, "); // Doesn't work

Segfault in DMD OSX

2014-09-22 Thread Etienne via Digitalmars-d-learn
I'm having issues with DMD returning exit code -11 rather than compiling my project. I have no idea how to debug this, I'm using Mac OS X 10.9.4 with latest git DMD tagged 2.066, and this project: https://github.com/etcimon/event.d When I hit `dub run`, I get the exit code. Not sure why or whe

Re: Segfault in DMD OSX

2014-09-22 Thread Etienne via Digitalmars-d-learn
I managed to get gdb running, here's what I get: Starting program: /bin/dmd -lib -m64 -g source/event/internals/epoll.d source/event/internals/kqueue.d source/event/internals/path.d source/event/internals/validator.d source/event/internals/hashmap.d source/event/internals/memory.d source/event

Re: Segfault in DMD OSX

2014-09-22 Thread Etienne via Digitalmars-d-learn
Here's with debug symbols in DMD Program received signal SIGSEGV, Segmentation fault. 0x00010013c4d0 in TemplateInstance::findBestMatch (this=0x101c34050, sc=0x12058d740, fargs=0x0) at template.c:7329 7329 tempdecl->kind(), tempdecl->parent->toPrettyChars(), tempdecl->ident->toChars()); (g

can't understand why code do not working

2014-09-22 Thread Suliman via Digitalmars-d-learn
Already 1 hour I am looking at example from http://ddili.org/ders/d.en/concurrency.html and my modification of it, and can't understand what's difference? Why it's output only: 1 3 and then do not do nothing! import std.stdio; import std.concurrency; import core.thread; void main() { Tid

Re: can't understand why code do not working

2014-09-22 Thread Ali Çehreli via Digitalmars-d-learn
On 09/22/2014 12:36 PM, Suliman wrote: void worker() { int value = 0; value = receiveOnly!int(); writeln(value); int result = value * 3; ownerTid.send(result); } Your worker terminates after receiving one int and sending one response. It should be waiting in a loop.

Re: can't understand why code do not working

2014-09-22 Thread Suliman via Digitalmars-d-learn
void worker() { int value = 0; while (value <=10) { value = receiveOnly!int(); writeln(value); int result = value * 3; ownerTid.send(result); } } give me: Running .\app1.exe 2 6 3 9 4 12 5 15 6 18 std.concurrency.OwnerTerminated@std\concurrency.d(

Re: can't understand why code do not working

2014-09-22 Thread Cliff via Digitalmars-d-learn
On Monday, 22 September 2014 at 20:12:28 UTC, Suliman wrote: void worker() { int value = 0; while (value <=10) { value = receiveOnly!int(); writeln(value); int result = value * 3; ownerTid.send(result); } } give me: Running .\app1.exe 2 6 3 9 4 1

New changes to DDOC where is the tag coming from in parent classes?

2014-09-22 Thread Gary Willoughby via Digitalmars-d-learn
Below is a change that results from re-generating my documentation using ddoc. I wonder where the new tags are coming from that wrap the parent class name. -class class="symbol">Button: tkd.widget.textwidget.TextWidget; +class class="symbol">Button: tkd.widget.textwidget.TextWidget; Has the

Re: can't understand why code do not working

2014-09-22 Thread monarch_dodra via Digitalmars-d-learn
On Monday, 22 September 2014 at 20:37:42 UTC, Cliff wrote: Is stdout threadsafe? Yes. All io operations lock in D, so are thread safe. You will never have interlaced io. If you want to do several opeations, then you can use LockingTextWriter, which is faster, s it locks once until you are fi

Re: can't understand why code do not working

2014-09-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/22/14 4:37 PM, Cliff wrote: Is stdout threadsafe? Yes, stdout is thread safe, it's based on C's stdout which is thread safe. -Steve

Re: can't understand why code do not working

2014-09-22 Thread monarch_dodra via Digitalmars-d-learn
On Monday, 22 September 2014 at 21:19:37 UTC, Steven Schveighoffer wrote: On 9/22/14 4:37 PM, Cliff wrote: Is stdout threadsafe? Yes, stdout is thread safe, it's based on C's stdout which is thread safe. -Steve Techinallly, though thread "safe", concurrent writes will create garbled te

Re: can't understand why code do not working

2014-09-22 Thread monarch_dodra via Digitalmars-d-learn
On Monday, 22 September 2014 at 20:12:28 UTC, Suliman wrote: std.concurrency.OwnerTerminated@std\concurrency.d(234): Owner terminated You need to make sure your main waits for its workers before exiting. When main "dies", it sends an exception message to anyone still working.

Re: can't understand why code do not working

2014-09-22 Thread Cliff via Digitalmars-d-learn
On Monday, 22 September 2014 at 21:28:25 UTC, Cliff wrote: On Monday, 22 September 2014 at 21:24:58 UTC, monarch_dodra wrote: On Monday, 22 September 2014 at 21:19:37 UTC, Steven Schveighoffer wrote: On 9/22/14 4:37 PM, Cliff wrote: Is stdout threadsafe? Yes, stdout is thread safe, it's ba

Re: can't understand why code do not working

2014-09-22 Thread Cliff via Digitalmars-d-learn
On Monday, 22 September 2014 at 21:24:58 UTC, monarch_dodra wrote: On Monday, 22 September 2014 at 21:19:37 UTC, Steven Schveighoffer wrote: On 9/22/14 4:37 PM, Cliff wrote: Is stdout threadsafe? Yes, stdout is thread safe, it's based on C's stdout which is thread safe. -Steve Techinal

Re: can't understand why code do not working

2014-09-22 Thread Ali Çehreli via Digitalmars-d-learn
On 09/22/2014 01:12 PM, Suliman wrote: > std.concurrency.OwnerTerminated@std\concurrency.d(234): Owner terminated > I feel bad about that uninteresting first example that lost you time. :( There are a number of options: - The main thread can call thread_joinAll() to wait for a

Does remove immutability using cast to pass in a function make sense?

2014-09-22 Thread AsmMan via Digitalmars-d-learn
I have this array: static immutable string[] months = ["jan", "fev", ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a reason related to design why it doesn't work with immutables

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-22 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 22 September 2014 at 03:30:22 UTC, Vladimir Panteleev wrote: On Monday, 22 September 2014 at 03:21:44 UTC, WhatMeWorry wrote: Anybody installed Visual D recently? As per the install instructions, I downloaded the Visual Studio isolated Shell 2013 and its integrated package. Everyt

Re: Does remove immutability using cast to pass in a function make sense?

2014-09-22 Thread Ali Çehreli via Digitalmars-d-learn
On 09/22/2014 07:07 PM, AsmMan wrote: I have this array: static immutable string[] months = ["jan", "fev", ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a reason related to design

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-22 Thread evilrat via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 03:14:27 UTC, WhatMeWorry wrote: On Monday, 22 September 2014 at 03:30:22 UTC, Vladimir Panteleev wrote: On Monday, 22 September 2014 at 03:21:44 UTC, WhatMeWorry wrote: Anybody installed Visual D recently? As per the install instructions, I downloaded the Vis

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-22 Thread evilrat via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 05:13:58 UTC, evilrat wrote: On Tuesday, 23 September 2014 at 03:14:27 UTC, WhatMeWorry wrote: I've downloaded the "isolated shell and the integrated package" installer and successfully installed them both. But after that I have no clue as to how to proceed. I o