RejectedSoftware Forums

Sign up

Pages: 1 2

Re: StdFileStream question

Am 09.11.2017 um 06:28 schrieb Dietmar Maurer:

Files don't support non-blocking operation, they will always be flagged
as ready for read/write. This will work, but always blocks. There are
some "files" that are actually sockets or pipes for which this will in
fact work, but not for regular files.

Ah, I see. But it will work perfectly for pipes and sockets.

I saw your PipedProcess implementation https://gist.github.com/s-ludwig/8434299 and noticed that this spawns up to 4 threads, where only one would be required?

Or is thread creation really that cheap and it is not worth to special case such things?

It's generally fast enough to not be noticeable for interactive
applications, but for anything that spawns many processes this is
definitely less than ideal, especially because it also has a non-trivial
memory footprint. This is also why I didn't put this into vibe.d so far.

It should be possible to make this work without starting any additional
thread, and when this gets integrated into vibe.d, that should
definitely be the goal.

Re: StdFileStream question

It should be possible to make this work without starting any additional
thread, and when this gets integrated into vibe.d, that should
definitely be the goal.

How would you do the final "wait" without using a thread?

Re: StdFileStream question

Am 09.11.2017 um 16:34 schrieb Dietmar Maurer:

It should be possible to make this work without starting any additional
thread, and when this gets integrated into vibe.d, that should
definitely be the goal.

How would you do the final "wait" without using a thread?

Basically on Windows, the process handle can be used in the
..WaitFor..Object family of functions, which is the base of the event
loop (MsgWaitForMultipleObjectsEx). On Posix systems, SIGCHLD can be
used to determine when a child process has exited (together with calling
waitpid to determine the actual PID and exit code).

Re: StdFileStream question

I am unable to use that dub packed, sigh :-/ It always fetches packages from remote instead of using the locally checked out versions.

my project config looks like:

"dependencies": {
	"vibe-d": "*",
    "vibe-d:core": "*",
},
    "subConfigurations": {
        "vibe-d:core": "vibe-core"
},

and I have locally checkout out version of vibe.d:

# dub list

...
vibe-d 0.8.2-alpha.3: /root/dlang-devel/vibe.d/

Re: StdFileStream question

On Fri, 10 Nov 2017 11:26:46 GMT, Dietmar Maurer wrote:

I am unable to use that dub packed, sigh :-/ It always fetches packages from remote instead of using the locally checked out versions.

my project config looks like:

"dependencies": {
	"vibe-d": "*",
    "vibe-d:core": "*",
},
    "subConfigurations": {
        "vibe-d:core": "vibe-core"
},

and I have locally checkout out version of vibe.d:

# dub list

...
vibe-d 0.8.2-alpha.3: /root/dlang-devel/vibe.d/

But then I run 'dub' it fetches vibe-d 0.8.1 instead of using 0.8.2-alpha.3

why?

Re: StdFileStream question

Am 10.11.2017 um 12:28 schrieb Dietmar Maurer:

On Fri, 10 Nov 2017 11:26:46 GMT, Dietmar Maurer wrote:

I am unable to use that dub packed, sigh :-/ It always fetches packages from remote instead of using the locally checked out versions.

my project config looks like:

"dependencies": {
	"vibe-d": "*",
    "vibe-d:core": "*",
},
     "subConfigurations": {
         "vibe-d:core": "vibe-core"
},

and I have locally checkout out version of vibe.d:

# dub list

...
vibe-d 0.8.2-alpha.3: /root/dlang-devel/vibe.d/

But then I run 'dub' it fetches vibe-d 0.8.1 instead of using 0.8.2-alpha.3

why?

Can you try to run "dub upgrade --prerelease"? By default, it will only
use release versions unless none is available. Alterantively, you could
also change the version referenced in dub.selections.json manually.

Re: StdFileStream question

Can you try to run "dub upgrade --prerelease"? By default, it will only
use release versions unless none is available.

That solved the problem - many thanks!!!

Pages: 1 2