Re: Help with Concurrency

2015-11-05 Thread Dmitri via Digitalmars-d-learn
On Tuesday, 3 November 2015 at 23:16:59 UTC, bertg wrote: I am having trouble with a simple use of concurrency. Running the following code I get 3 different tid's, multiple "sock in" messages printed, but no receives. I am supposed to get a "received!" for each "sock in", but I am getting

Re: Help with Concurrency

2015-11-04 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 3 November 2015 at 23:16:59 UTC, bertg wrote: while (true) { writeln("receiving..."); std.concurrency.receive( (string msg) { writeln("conn: received ws message: " ~ msg); } );

Re: Help with Concurrency

2015-11-04 Thread JR via Digitalmars-d-learn
On Tuesday, 3 November 2015 at 23:16:59 UTC, bertg wrote: Running the following code I get 3 different tid's, multiple "sock in" messages printed, but no receives. I am supposed to get a "received!" for each "sock in", but I am getting hung up on "receiving...". [...] while (true)

Re: Help with Concurrency

2015-11-04 Thread JR via Digitalmars-d-learn
On Wednesday, 4 November 2015 at 16:49:59 UTC, JR wrote: [...] And my indentation and brace-balancing there is wrong. Shows how dependent I've become on syntax highlighting. import core.time; import std.concurrency; bool received = receiveTimeout(1.seconds,

Re: Help with Concurrency

2015-11-03 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 3 November 2015 at 23:16:59 UTC, bertg wrote: I am having trouble with a simple use of concurrency. Running the following code I get 3 different tid's, multiple "sock in" messages printed, but no receives. I am supposed to get a "received!" for each "sock in", but I am getting

Help with Concurrency

2015-11-03 Thread bertg via Digitalmars-d-learn
I am having trouble with a simple use of concurrency. Running the following code I get 3 different tid's, multiple "sock in" messages printed, but no receives. I am supposed to get a "received!" for each "sock in", but I am getting hung up on "receiving...". Am I misusing or

Re: Help with Concurrency

2015-11-03 Thread bertg via Digitalmars-d-learn
On Wednesday, 4 November 2015 at 01:27:57 UTC, Nicholas Wilson wrote: On Tuesday, 3 November 2015 at 23:16:59 UTC, bertg wrote: [...] Try replacing the following loop to have a receive that times out or while(true) to while(web socked.connected) [...] That didn't solve the problem. How

Need help with concurrency

2015-02-24 Thread FrankLike via Digitalmars-d-learn
Hello,everyone,what is a better way with concurrency? http://forum.dlang.org/thread/urqxiaairpnrjggqd...@forum.dlang.org Thank you.

Re: Help with concurrency - traversing a DAG

2013-10-23 Thread qznc
On Tuesday, 22 October 2013 at 08:13:57 UTC, tbttfox wrote: On Friday, 18 October 2013 at 19:47:37 UTC, qznc wrote: Create a task for each node without a parent. Let the tasks create new tasks for their children. I was finally able to try this out, but I'm having a problem. My test case right

Re: Help with concurrency - traversing a DAG

2013-10-22 Thread tbttfox
On Friday, 18 October 2013 at 19:47:37 UTC, qznc wrote: Create a task for each node without a parent. Let the tasks create new tasks for their children. I was finally able to try this out, but I'm having a problem. My test case right now is a simple linked list, and what I think happens is

Help with concurrency - traversing a DAG

2013-10-18 Thread tbttfox
So I've got a project in mind, and at the core of that project is a DAG with lots of nodes. This seems to be a great candidate for concurrent evaluation. The problem is that a node can only be evaluated after all of its parents have. I'm really new to D and static typing in general (coming

Re: Help with concurrency - traversing a DAG

2013-10-18 Thread qznc
On Friday, 18 October 2013 at 07:20:07 UTC, tbttfox wrote: So I've got a project in mind, and at the core of that project is a DAG with lots of nodes. This seems to be a great candidate for concurrent evaluation. The problem is that a node can only be evaluated after all of its parents have.

Re: Help with concurrency - traversing a DAG

2013-10-18 Thread tbttfox
On Friday, 18 October 2013 at 11:40:24 UTC, qznc wrote: On Friday, 18 October 2013 at 07:20:07 UTC, tbttfox wrote: So I've got a project in mind, and at the core of that project is a DAG with lots of nodes. This seems to be a great candidate for concurrent evaluation. The problem is that a

Re: Help with concurrency - traversing a DAG

2013-10-18 Thread qznc
On Friday, 18 October 2013 at 16:31:13 UTC, tbttfox wrote: My not currently not working implementation has the workers make a pull request from the master. As far as I understand you just want something working right now? Then my suggestion would be to look into std.parallelism [0]. Create a

Re: Help with concurrency - traversing a DAG

2013-10-18 Thread tbttfox
As far as I understand you just want something working right now? Then my suggestion would be to look into std.parallelism [0]. Create a task for each node without a parent. Let the tasks create new tasks for their children. Yeah, I'm just trying to get something working right now, so I will