Re: Allocate more space for fiber if gardpage hit?

2020-04-23 Thread Kaitlyn Emmons via Digitalmars-d-learn

On Friday, 24 April 2020 at 04:50:12 UTC, Kaitlyn Emmons wrote:

Is it possible on windows to dynamically size fibers?


follow up question, if i allocate way more space for a bunch of 
fibers then they need, will the space just get reserved? EG if i 
have a fiber that never goes beyond 4 pages but i create it with 
32... will the later pages ever get assigned physical memory?





Allocate more space for fiber if gardpage hit?

2020-04-23 Thread Kaitlyn Emmons via Digitalmars-d-learn

Is it possible on windows to dynamically size fibers?


Re: Integration testing, unit-threaded, and threads

2020-04-23 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2020-04-23 at 14:41 +0300, drug via Digitalmars-d-learn wrote:
> 
[…]
> Did you try `dub test -- -s`?

Oh f###, that is about the only combination I didn't try. :-(

Thanks. Problem solved. :-)

Not sure about the Fixture proposal, I will research and cogitate
further.


-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



signature.asc
Description: This is a digitally signed message part


Re: Integration testing, unit-threaded, and threads

2020-04-23 Thread drug via Digitalmars-d-learn

23.04.2020 14:01, Russel Winder пишет:

Hi,

I need to start a process before the tests run, and terminate it after
the tests run. A module with a shared static constructor and shared
static destructor sounds like the way of doing this since the
constructor is run before main and the destructor after main. However I
am using unit-threaded, not for the threads but because it is great for
a whole load of other reasons. In fact the threads are becoming a
problem.

As far as I can tell main is terminating before all the tests are
complete which means the shared static destructor is executing before
all the tests are complete.


I would use Fixture (a class derived form TestCase) here and derive all 
tests from it. It allows you to start your process before all test in 
`setup()` Fixture member and terminate it after in `` and probably lets 
you run the tests simultaneously.



To test this hypothesis I want to run single threaded. unit-threaded
says this is possible using a command line option -s. The question is
which command line? dub test doesn't accept it and neither does the dub
command creating ut_main.d



Did you try `dub test -- -s`?


Re: Integration testing, unit-threaded, and threads

2020-04-23 Thread drug via Digitalmars-d-learn

23.04.2020 14:41, drug пишет:

terminate it after in ``


terminate it after in `shutdown()`


Re: Option and Result [was Integration tests]

2020-04-23 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2020-04-21 at 21:29 +, aliak via Digitalmars-d-learn wrote:
> On Tuesday, 21 April 2020 at 16:30:15 UTC, Russel Winder wrote:
[…]
> 
> There've been a few attempts at building a Result type:
> 
> https://code.dlang.org/search?q=expect
> And here: 
> https://github.com/aliak00/ddash/blob/master/utils/source/ddash/utils/expect.d
> 
> > Is Option intended for adding to Phobos?
> 
> Not that I am aware of. There was an attempt to PR an Option type 
> way back when which never made it: 
> https://github.com/dlang/phobos/pull/3915
> 
> There was a post here: 
> https://forum.dlang.org/thread/hqtdekjtdgbhhbjgy...@forum.dlang.org

Perhaps there can be one implementation package of Nullable, Option,
and Result that is in the Dub repository that everyone can use even though they 
really ought to be part of Phobos.

-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



signature.asc
Description: This is a digitally signed message part


Integration testing, unit-threaded, and threads

2020-04-23 Thread Russel Winder via Digitalmars-d-learn
Hi,

I need to start a process before the tests run, and terminate it after
the tests run. A module with a shared static constructor and shared
static destructor sounds like the way of doing this since the
constructor is run before main and the destructor after main. However I
am using unit-threaded, not for the threads but because it is great for
a whole load of other reasons. In fact the threads are becoming a
problem.

As far as I can tell main is terminating before all the tests are
complete which means the shared static destructor is executing before
all the tests are complete.

To test this hypothesis I want to run single threaded. unit-threaded
says this is possible using a command line option -s. The question is
which command line? dub test doesn't accept it and neither does the dub
command creating ut_main.d

-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



signature.asc
Description: This is a digitally signed message part