Re: Thread communication

2015-08-05 Thread 岩倉 澪
On Wednesday, 5 August 2015 at 14:31:20 UTC, Marc Schütz wrote: It was a conscious decision not to provide a kill method for threads, because it is impossible to guarantee that your program is still consistent afterwards. What about the situation where we want to kill worker threads off when

Re: Using rdmd to create shared object files

2015-08-05 Thread cym13 via Digitalmars-d-learn
On Sunday, 2 August 2015 at 19:04:15 UTC, Malte Kießling wrote: Hello, I am trying to use rdmd to create shared object files. The command that I am using is "rdmd --build-only -shared -fPIC -defaultlib= foo.d" This creates a file called "foo" - wich is not exactly what I expectd. However "d

Re: D Wiki: Windows programming examples are missing

2015-08-05 Thread anonymous via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 21:02:49 UTC, Andre Polykanine wrote: Hi everyone, I'm fairly new to D and am really excited about it. I would like to see more examples of Windows programming in D, but the repository indicated on the D wiki seems to be moved or deleted. More info is here: http:/

D Wiki: Windows programming examples are missing

2015-08-05 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone, I'm fairly new to D and am really excited about it. I would like to see more examples of Windows programming in D, but the repository indicated on the D wiki seems to be moved or deleted. More info is here: http://wiki.dlang.org/talk:D_for_Win32 Thanks! -- With best regards from Ukra

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread DarthCthulhu via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: On Wednesday, 5 August 2015 at 01:02:56 UTC, DarthCthulhu wrote: I must be doing something really stupid here, but I have no clue what it is. Anyone know? For functional behaviour I prefer a postblit that duplicates the underlying B

Re: What is the order of resolution for super() calls?

2015-08-05 Thread anonymous via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 12:32:48 UTC, cym13 wrote: For reference, as the diagram was unreadable, I'll describe it here: class Adam ; class Eve ; class Abel:Adam,Eve ; class Cain:Adam,Eve ; class David:Abel,Cain ; This is illegal D. You must use interfaces to simulate multiple inherita

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 15:29:39 UTC, Nordlöw wrote: On Wednesday, 5 August 2015 at 13:37:19 UTC, John Colvin wrote: On Wednesday, 5 August 2015 at 11:09:29 UTC, Per Nordlöw wrote: On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: This will however duplicate the underlying arra

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread Nordlöw
On Wednesday, 5 August 2015 at 13:37:19 UTC, John Colvin wrote: On Wednesday, 5 August 2015 at 11:09:29 UTC, Per Nordlöw wrote: On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: This will however duplicate the underlying array aswell, which is probably not what we want. How do we avoi

Re: Thread communication

2015-08-05 Thread via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 14:34:42 UTC, Alex Parrill wrote: On Wednesday, 5 August 2015 at 14:31:20 UTC, Marc Schütz wrote: Maybe we can lift this restriction if we know that the thread's main function is pure and takes no references to mutable data, because then it can by definition never

Re: Thread communication

2015-08-05 Thread via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 11:23:28 UTC, Chris wrote: The problem is that it works up to a certain extent with receiveTimeout. However, if the input arrives in very short intervals, all the solutions I've come up with so far (including data sharing) fail sooner or later. New threads are sp

Re: Thread communication

2015-08-05 Thread Alex Parrill via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 14:31:20 UTC, Marc Schütz wrote: Maybe we can lift this restriction if we know that the thread's main function is pure and takes no references to mutable data, because then it can by definition never mess up the program's state. That'd be a pretty useless thread

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 11:09:29 UTC, Per Nordlöw wrote: On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: This will however duplicate the underlying array aswell, which is probably not what we want. How do we avoid this? Correction: the underlying storage array *must* be dupl

Re: What is the order of resolution for super() calls?

2015-08-05 Thread cym13 via Digitalmars-d-learn
Forget it, I just remembered that we only do single inheritance, and I don't think the same problem occurs with interfaces. For reference, as the diagram was unreadable, I'll describe it here: class Adam ; class Eve ; class Abel:Adam,Eve ; class Cain:Adam,Eve ; class David:Abel,Cain ;

What is the order of resolution for super() calls?

2015-08-05 Thread cym13 via Digitalmars-d-learn
Hi, I just read https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ which describes how super works in python (tl;dr: it's completely different from C++, java or D's super but super cool to deal with multiple inheritance). For example, for the following inheritance tree:

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/5/15 7:09 AM, "Per =?UTF-8?B?Tm9yZGzDtnci?= " wrote: On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: This will however duplicate the underlying array aswell, which is probably not what we want. How do we avoid this? Correction: the underlying storage array *must* be duplicated

Re: Thread communication

2015-08-05 Thread Chris via Digitalmars-d-learn
On Tuesday, 4 August 2015 at 18:15:08 UTC, Ali Çehreli wrote: On 08/04/2015 09:19 AM, Dicebot wrote: receiveTimeout I think the problem here is that the worker is busy, not even able to call that. This sounds like sending a signal to the specific thread (with pthread_kill()) but I don't kn

Re: Thread communication

2015-08-05 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 4 August 2015 at 15:19:51 UTC, Chris wrote: I want to stop (and abort) the worker as soon as new input arrives. However, while executing the function that contains the foreach-loop the worker thread doesn't listen, because it's busy, of course. I think this is a matter of archite

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: This will however duplicate the underlying array aswell, which is probably not what we want. How do we avoid this? Correction: the underlying storage array *must* be duplicated whenever we want to iterate over it without side effects

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 09:04:54 UTC, Nordlöw wrote: For functional behaviour I prefer a postblit that duplicates the underlying BinaryHeap. The postblit is the this(this) { ... }

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread via Digitalmars-d-learn
On Wednesday, 5 August 2015 at 02:26:48 UTC, Meta wrote: It looks like there was a breaking change made to BinaryHeap somewhere between 2.065 and the present. The code compiles fine on 2.065. http://dpaste.dzfl.pl/65ba735d69e7 It was this PR that changed the behaviour: https://github.com/D-P

Re: Creating a Priority Queue: An Adventure

2015-08-05 Thread Nordlöw
On Wednesday, 5 August 2015 at 01:02:56 UTC, DarthCthulhu wrote: I must be doing something really stupid here, but I have no clue what it is. Anyone know? For functional behaviour I prefer a postblit that duplicates the underlying BinaryHeap. https://github.com/nordlow/justd/blob/master/pri