wrote a
small performance measurement: put 10,000 things in a FIFO,
pull them back out, and loop around that 10,000 times. My FIFO
resulted in:
Also try the code I gave in this thread:
https://forum.dlang.org/post/fgzvdhkdyevtzznya...@forum.dlang.org
In fact, please use this facility i
wrote a
small performance measurement: put 10,000 things in a FIFO,
pull them back out, and loop around that 10,000 times. My FIFO
resulted in:
real0m1.589s
user0m1.585s
sys 0m0.004s
And the dlist based one:
real0m4.731s
user0m5.211s
sys 0m0.308s
Representing the FIFO
On Monday, 13 May 2024 at 15:07:39 UTC, Andy Valencia wrote:
Representing the FIFO as a linked list clearly has its cost,
but I found the increased system time interesting. OS memory
allocations maybe?
I know you want FIFO, I usually keep this on hand for fixed size
LIFO; It can easily
On Sunday, 12 May 2024 at 22:03:21 UTC, Ferhat Kurtulmuş wrote:
https://dlang.org/phobos/std_container_slist.html
This is a stack, isn't it? LIFO?
Ahh yes. Then use dlist
Thank you. I read its source, and was curious so I wrote a small
performance measurement: put 10,000 things in a
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote:
I need a FIFO for a work scheduler, and nothing suitable jumped
out at me. I wrote the following, but as a newbie, would be
happy to receive any suggestions or observations. TIA!
[...]
I don't know your use case, mayb
On Sunday, 12 May 2024 at 21:08:24 UTC, Andy Valencia wrote:
On Sunday, 12 May 2024 at 19:45:44 UTC, Ferhat Kurtulmuş wrote:
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote:
I need a FIFO for a work scheduler, and nothing suitable
jumped out at me.
...
https://dlang.org/phobos
On Sunday, 12 May 2024 at 19:45:44 UTC, Ferhat Kurtulmuş wrote:
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote:
I need a FIFO for a work scheduler, and nothing suitable
jumped out at me.
...
https://dlang.org/phobos/std_container_slist.html
This is a stack, isn't it?
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote:
I need a FIFO for a work scheduler, and nothing suitable jumped
out at me. I wrote the following, but as a newbie, would be
happy to receive any suggestions or observations. TIA!
[...]
"next" is not a usual range
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote:
I need a FIFO for a work scheduler, and nothing suitable jumped
out at me. I wrote the following, but as a newbie, would be
happy to receive any suggestions or observations. TIA!
[...]
https://dlang.org/phobos
I need a FIFO for a work scheduler, and nothing suitable jumped
out at me. I wrote the following, but as a newbie, would be
happy to receive any suggestions or observations. TIA!
/*
* fifo.d
* FIFO data structure
*/
module tiny.fifo;
import std.exception : enforce;
const uint GROWBY
On Fri, Jan 15, 2021 at 08:19:18PM +, tsbockman via Digitalmars-d-learn
wrote:
[...]
> However, generational GCs are somewhat closer to LIFO than what we
> have now, which does provide some performance gains under common usage
> patterns. People have discussed adding a generational GC to D in
On Friday, 15 January 2021 at 12:39:30 UTC, MGW wrote:
GC cleans memory using the FIFO paradigm. Is it possible to
switch GC to work using the LIFO paradigm?
As others already said, the current GC isn't FIFO; it just scans
everything once in a while a frees whatever it can, new o
On Friday, 15 January 2021 at 12:39:30 UTC, MGW wrote:
GC cleans memory using the FIFO paradigm. Is it possible to
switch GC to work using the LIFO paradigm?
AFAIK the GC just sweeps, and the only queue is for destructors
(unreachable memory) iirc
On 1/15/21 7:39 AM, MGW wrote:
GC cleans memory using the FIFO paradigm. Is it possible to switch GC to
work using the LIFO paradigm?
I'm not sure what you mean. I don't think there's any guaranteed order
for GC cleanup.
-Steve
GC cleans memory using the FIFO paradigm. Is it possible to
switch GC to work using the LIFO paradigm?
On Monday, 3 December 2018 at 23:32:10 UTC, Anonymouse wrote:
I have a fifo that I want to read lines from, but everything is
blocking.
[...]
How can I go about doing this to get non-blocking reads? Or
perhaps a way to test whether there is text waiting in the
fifo? File.eof is not it
On Mon, Dec 03, 2018 at 11:32:10PM +, Anonymouse via Digitalmars-d-learn
wrote:
> I have a fifo that I want to read lines from, but everything is
> blocking.
>
> execute([ "mkfifo", filename ]);
> File fifo = File(filename, "r"); // blocks alre
I have a fifo that I want to read lines from, but everything is
blocking.
execute([ "mkfifo", filename ]);
File fifo = File(filename, "r"); // blocks already
immutable input = fifo.readln(); // blocks
foreach (line; fifo.byLineCopy) { /* blocks */ }
How can I go about d
On 6/1/2018 12:06 AM, vino.B wrote:
On Thursday, 24 May 2018 at 11:31:15 UTC, bauss wrote:
On Thursday, 24 May 2018 at 06:59:47 UTC, Vino wrote:
Hi All,
Request your help on how to delete a file which has the extension
.fifo (.javast.fifo) in Windows.
From,
Vino.B
What exactly is your
On Thursday, 24 May 2018 at 11:31:15 UTC, bauss wrote:
On Thursday, 24 May 2018 at 06:59:47 UTC, Vino wrote:
Hi All,
Request your help on how to delete a file which has the
extension .fifo (.javast.fifo) in Windows.
From,
Vino.B
What exactly is your issue with it?
Hi Bauss,
We have
On Thursday, 24 May 2018 at 06:59:47 UTC, Vino wrote:
Hi All,
Request your help on how to delete a file which has the
extension .fifo (.javast.fifo) in Windows.
From,
Vino.B
What exactly is your issue with it?
Hi All,
Request your help on how to delete a file which has the
extension .fifo (.javast.fifo) in Windows.
From,
Vino.B
Am 26.10.2011, 18:00 Uhr, schrieb Dominic Jones :
Also an plain array is a good stack. :)
I'd rather not use a plain array because (I assume) that when I push
or pop using arrays, a swap array is created to resize the original.
If this is not the case, then an array will certainly do.
-Dominic
Dominic Jones wrote:
> Hello,
>
> I was looking for a FIFO stack in std.containers but only found SList
> and Array which both appear to essentially operate as LIFO stacks. Is
> there any standard container with which I can push items on to a list,
> then later pop them off
On Friday, October 28, 2011 13:24:58 Dominic Jones wrote:
> To conclude the matter regarding the absence of a FIFO stack in the
> standard library and the not so good alternative of arrays (in
> particular where there are a significant number of push-pops and the
> maximum length is n
To conclude the matter regarding the absence of a FIFO stack in the
standard library and the not so good alternative of arrays (in
particular where there are a significant number of push-pops and the
maximum length is not initially known):
Does anyone in-the-know know if something like "DLis
"Ary Manzana" wrote in message
news:j8buhd$1s80$1...@digitalmars.com...
> On 10/27/11 8:38 AM, Nick Sabalausky wrote:
>> "Ary Manzana" wrote in message
>> news:j89gle$9nn$1...@digitalmars.com...
>>> On 10/26/11 1:28 PM, Jonathan M Davis wrote:
On Wednesday, October 26, 2011 09:00 Dominic Jo
On 10/27/11 8:38 AM, Nick Sabalausky wrote:
"Ary Manzana" wrote in message
news:j89gle$9nn$1...@digitalmars.com...
On 10/26/11 1:28 PM, Jonathan M Davis wrote:
On Wednesday, October 26, 2011 09:00 Dominic Jones wrote:
Also an plain array is a good stack. :)
I'd rather not use a plain array
y is created to resize the original.
If this is not the case, then an array will certainly do.
-Dominic
The matter of using D's arrays as a LIFO is discussed the other branch of
this thread (ie, you can do it, but it's slow because a "pop then push"
will
reallocate and co
d (ie, you can do it, but it's slow because a "pop then push" will
> reallocate and copy), but as far as a FIFO: That may actually be reasonable
> to do as an array:
>
> Decreasing the length of an array (from either end) is a trivial matter that
> never allocates
If this is not the case, then an array will certainly do.
> -Dominic
The matter of using D's arrays as a LIFO is discussed the other branch of
this thread (ie, you can do it, but it's slow because a "pop then push" will
reallocate and copy), but as far as a FIFO: That ma
"Ary Manzana" wrote in message
news:j89gle$9nn$1...@digitalmars.com...
> On 10/26/11 1:28 PM, Jonathan M Davis wrote:
>> On Wednesday, October 26, 2011 09:00 Dominic Jones wrote:
Also an plain array is a good stack. :)
>>>
>>> I'd rather not use a plain array because (I assume) that when I p
On 10/26/2011 07:38 PM, Ary Manzana wrote:
On 10/26/11 1:28 PM, Jonathan M Davis wrote:
On Wednesday, October 26, 2011 09:00 Dominic Jones wrote:
Also an plain array is a good stack. :)
I'd rather not use a plain array because (I assume) that when I push
or pop using arrays, a swap array is c
Ary Manzana Wrote:
> On 10/26/11 1:28 PM, Jonathan M Davis wrote:
> > Not exactly. If you want to know more about how arrays work, you should read
> > this: http://www.dsource.org/projects/dcollections/wiki/ArrayArticle It's a
> > great read. As for using an array as a stack, you can do it with a
On Wednesday, October 26, 2011 10:38 Ary Manzana wrote:
> On 10/26/11 1:28 PM, Jonathan M Davis wrote:
> > On Wednesday, October 26, 2011 09:00 Dominic Jones wrote:
> >>> Also an plain array is a good stack. :)
> >>
> >> I'd rather not use a plain array because (I assume) that when I push
> >> or
On 10/26/11 1:28 PM, Jonathan M Davis wrote:
On Wednesday, October 26, 2011 09:00 Dominic Jones wrote:
Also an plain array is a good stack. :)
I'd rather not use a plain array because (I assume) that when I push
or pop using arrays, a swap array is created to resize the original.
If this is no
On Wednesday, October 26, 2011 09:00 Dominic Jones wrote:
> > Also an plain array is a good stack. :)
>
> I'd rather not use a plain array because (I assume) that when I push
> or pop using arrays, a swap array is created to resize the original.
> If this is not the case, then an array will certai
> Also an plain array is a good stack. :)
I'd rather not use a plain array because (I assume) that when I push
or pop using arrays, a swap array is created to resize the original.
If this is not the case, then an array will certainly do.
-Dominic
Am 26.10.2011, 17:20 Uhr, schrieb Simen Kjaeraas :
On Wed, 26 Oct 2011 17:15:37 +0200, Simen Kjaeraas
wrote:
On Wed, 26 Oct 2011 10:58:12 +0200, Dominic Jones
wrote:
Hello,
I was looking for a FIFO stack in std.containers but only found SList
and Array which both appear to
On Wed, 26 Oct 2011 17:15:37 +0200, Simen Kjaeraas
wrote:
On Wed, 26 Oct 2011 10:58:12 +0200, Dominic Jones
wrote:
Hello,
I was looking for a FIFO stack in std.containers but only found SList
and Array which both appear to essentially operate as LIFO stacks. Is
there any standard
On Wed, 26 Oct 2011 10:58:12 +0200, Dominic Jones
wrote:
Hello,
I was looking for a FIFO stack in std.containers but only found SList
and Array which both appear to essentially operate as LIFO stacks. Is
there any standard container with which I can push items on to a list,
then later pop
On Wednesday, October 26, 2011 08:58:12 Dominic Jones wrote:
> Hello,
>
> I was looking for a FIFO stack in std.containers but only found SList
> and Array which both appear to essentially operate as LIFO stacks. Is
> there any standard container with which I can push items on to
Hello,
I was looking for a FIFO stack in std.containers but only found SList
and Array which both appear to essentially operate as LIFO stacks. Is
there any standard container with which I can push items on to a list,
then later pop them off from the bottom of that list? If so, then how?
Thank
43 matches
Mail list logo