On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
I have another question: it seems I can spawn hundreds of
threads
(Heck, even 10_000 is accepted), even when I have 4-8 cores. Is
there:
is there a limit to the number of threads? I tried a threadpool
On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
This is correct – the LLVM optimizer indeed gets rid of the
loop completely.
OK,that's clever. But I get this even when put a writeln(some
msg)
inside the task. I thought a write couldn't be optimized
On Sunday, 3 August 2014 at 23:41:27 UTC, Freddy wrote:
I am currently working on a phobos fork to include associative
ranges, however the unittest fail when i try to build. How am a
supposed test any unittests that i add.
link:https://github.com/Superstar64/phobos/tree/associative_ranges
$
Without going into much detail: Threads are heavy, and creating a thread is
an expensive operation (which is partially why virtually every standard
library includes a ThreadPool).
I haven't looked into detail your code, but consider using the TaskPool if
you just want to schedule some tasks
On Monday, 4 August 2014 at 12:05:31 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
OK, I get it. Just to be sure, there is no ThreadPool in Phobos
or in
core, right?
IIRC, there are fibers somewhere in core, I'll have a look. I
also
heard the vibe.d has them.
There is. It's called
On Mon, Aug 4, 2014 at 2:13 PM, Chris Cain via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
OK, I get it. Just to be sure, there is no ThreadPool in Phobos or in
core, right?
There is. It's called taskPool, though:
http://dlang.org/phobos/std_parallelism.html#.taskPool
Ah,
I took a look and I don't really know if it's possible without
using the Emacs 24 only suggestion in the Stack Overflow
comment to your question.
As far as I can see, before that Emacs syntax tables have a
notion of what a string is and what an escape character is. The
d-mode code adds the
On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
I have another question: it seems I can spawn hundreds of
threads
(Heck, even 10_000 is accepted), even when I have 4-8 cores. Is
there:
is there a limit to the number of threads? I tried a threadpool
On Monday, 4 August 2014 at 12:05:31 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
IIRC, there are fibers somewhere in core, I'll have a look. I
also
heard the vibe.d has them.
http://dlang.org/phobos/core_thread.html#.Fiber
vibe.d adds some own abstraction on top, for example Task
On Mon, Aug 4, 2014 at 3:36 PM, Dicebot via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Most likely those threads either do nothing or are short living so you don't
get actually 10 000 threads running simultaneously. In general you should
expect your operating system to start
On Monday, 4 August 2014 at 14:56:36 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Mon, Aug 4, 2014 at 3:36 PM, Dicebot via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Modern default approach is to have amount of worker threads
identical or
close to amount of CPU cores
On Monday, 4 August 2014 at 14:56:36 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Mon, Aug 4, 2014 at 3:36 PM, Dicebot via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Most likely those threads either do nothing or are short
living so you don't
get actually 10 000
Sorry, I missed this thread (!) till now.
On Mon, 2014-08-04 at 13:36 +, Dicebot via Digitalmars-d-learn
wrote:
On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
I have another question: it seems I can spawn hundreds of
threads
(Heck, even
On Monday, 4 August 2014 at 16:38:24 UTC, Russel Winder via
Digitalmars-d-learn wrote:
Modern default approach is to have amount of worker threads
identical or close to amount of CPU cores and handle internal
scheduling manually via fibers or some similar solution.
I have no current data, but
On Sunday, 3 August 2014 at 23:48:09 UTC, Martin wrote:
When I use the spawnProcess function in std.process, the
command line arguments that I provide to the function seem to
get quoted.
I can't reproduce this on OS X with 2.066rc1 (args are unquoted).
Can someone else check Windows? Sounds
On Mon, 2014-08-04 at 16:57 +, Dicebot via Digitalmars-d-learn
wrote:
[…]
This is why I had or close remark :) Exact number almost always
depends on exact deployment layout - i.e. what other processes
are running in the system, how hardware interrupts are handled
and so on. It is
On Monday, 4 August 2014 at 18:22:47 UTC, Russel Winder via
Digitalmars-d-learn wrote:
Actually with CSP / actor model one can simply consider
long-running CPU computation as form of I/O an apply same
asynchronous design techniques. For example, have separate
dedicated thread running the
TLDR -- Calling D code from Haskell through the FFI works with
DMD but not with GDC or LDC2.
The time consuming version:
Since D allows C to directly call it, if the D code is wrapped in
extern (C){ ... }, I thought it should be possible to call such D
code from Haskell using the FFI.
The
Don't forget to call rt_init:
http://dlang.org/phobos/core_runtime.html#.rt_init
On Monday, 4 August 2014 at 21:10:46 UTC, safety0ff wrote:
Don't forget to call rt_init:
http://dlang.org/phobos/core_runtime.html#.rt_init
Where/when should I call this?
On Mon, Aug 4, 2014 at 6:21 PM, Dicebot via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
vibe.d additions may help here:
http://vibed.org/api/vibe.core.core/runTask
http://vibed.org/api/vibe.core.core/runWorkerTask
http://vibed.org/api/vibe.core.core/workerThreadCount
task
I am trying to build some simple command line applications that I
have written in python as a way to learn D. Can you give some
examples for me? For instance, I think I remember once seeing
somewhere in the documentation an example that took several D
files and compiled them all by running
On Monday, 4 August 2014 at 21:14:17 UTC, Jon wrote:
On Monday, 4 August 2014 at 21:10:46 UTC, safety0ff wrote:
Don't forget to call rt_init:
http://dlang.org/phobos/core_runtime.html#.rt_init
Where/when should I call this?
Before calling any D functions, but usually it's simplest to call
On Mon, Aug 4, 2014 at 6:38 PM, Russel Winder via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Are these std.concurrent threads or std.parallelism tasks?
A std.parallelism task is not a thread. Like Erlang or Java Fork/Join
framework, the program specifies units of work and
I get Error: core.runtime.rt_init is private. And Error:
core.runtime.init is not accessible.
On Monday, 4 August 2014 at 21:22:37 UTC, safety0ff wrote:
On Monday, 4 August 2014 at 21:14:17 UTC, Jon wrote:
On Monday, 4 August 2014 at 21:10:46 UTC, safety0ff wrote:
Don't forget to call
On Monday, 4 August 2014 at 21:19:14 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
Has anyone used (the fiber/taks of) vibe.d for something other
than
powering websites?
Atila has implemented MQRR broker with it :
https://github.com/atilaneves/mqtt
It it still networking application
On Monday, 4 August 2014 at 21:35:21 UTC, Jon wrote:
I get Error: core.runtime.rt_init is private. And Error:
core.runtime.init is not accessible.
I would add them to the header and Haskell wrapper
(FunctionsInD.h and ToD.hs.)
The signatures are:
int rt_init();
int rt_term();
When it is
I am a little bit confused as to what you want.
There is a command line example at dlang.org, and there exists a program
(rdmd) that compiles several D files and runs them.
http://dlang.org/rdmd.html
2014-08-04 23:20 GMT+02:00 TJB via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com:
I
Hello everyone,
I'm trying to write a command-line application that can detect
whether the input file is gzipped or not. Sounds simple enough,
but I can't seem to do it properly in D (this is my first foray
to the language).
After checking whether the file is gzipped or not, I try to
On Monday, 4 August 2014 at 21:58:09 UTC, maarten van damme via
Digitalmars-d-learn wrote:
I am a little bit confused as to what you want.
There is a command line example at dlang.org, and there exists
a program
(rdmd) that compiles several D files and runs them.
http://dlang.org/rdmd.html
On Monday, 4 August 2014 at 22:00:18 UTC, splatterdash wrote:
```
File f = File(input_file)
// detect gzip ...
if (isGzip)
{
auto fileIter = new MyFileReader!GzipIterator(f)
}
else
{
auto fileIter = new MyFileReader!NormalIterator(f)
}
foreach(string line; fileIter) {
// do
Yes, thank you. That is exactly what I did.
On Monday, 4 August 2014 at 21:48:40 UTC, safety0ff wrote:
On Monday, 4 August 2014 at 21:35:21 UTC, Jon wrote:
I get Error: core.runtime.rt_init is private. And Error:
core.runtime.init is not accessible.
I would add them to the header and
On Monday, 4 August 2014 at 22:09:49 UTC, anonymous wrote:
On Monday, 4 August 2014 at 22:00:18 UTC, splatterdash wrote:
```
File f = File(input_file)
// detect gzip ...
if (isGzip)
{
auto fileIter = new MyFileReader!GzipIterator(f)
}
else
{
auto fileIter = new
On Monday, 4 August 2014 at 22:18:24 UTC, splatterdash wrote:
Indeed I do. I'm not sure which type I should use for the
common base type, though. MyFileReader is a templated class, so
using it plainly did not work. I also tried `InputRange!string`
to no avail despite `MyFileReader`
On Monday, 4 August 2014 at 10:30:40 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 23:41:27 UTC, Freddy wrote:
I am currently working on a phobos fork to include associative
ranges, however the unittest fail when i try to build. How am a
supposed test any unittests that i add.
On Monday, 4 August 2014 at 21:19:14 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
Has anyone used (the fiber/taks of) vibe.d for something other
than powering websites?
https://github.com/D-Programming-Language/phobos/pull/1910
As a note, I can interact with strings as expected, but working
with structs looks like it will take a little bit of work.
On Monday, 4 August 2014 at 22:17:36 UTC, Jon wrote:
Yes, thank you. That is exactly what I did.
On Monday, 4 August 2014 at 21:48:40 UTC, safety0ff wrote:
On Monday, 4
Is there a way to take a bounded rage from a infinite forward range?
Given the Fibonacci sequence:
auto fib = recurrence!(a[n-1] + a[n-2])(1, 1);
I can take the first n elements:
take(fib, 10);
But say I want all positive elements below 5 in value (there are
eight such
On Tuesday, 5 August 2014 at 01:23:19 UTC, Andrew Edwards wrote:
Is there a way to take a bounded rage from a infinite forward
range?
Given the Fibonacci sequence:
auto fib = recurrence!(a[n-1] + a[n-2])(1, 1);
I can take the first n elements:
take(fib, 10);
But say I want
On 8/5/14, 10:28 AM, Brad Anderson wrote:
On Tuesday, 5 August 2014 at 01:23:19 UTC, Andrew Edwards wrote:
Is there a way to take a bounded rage from a infinite forward range?
I'd use std.algorithm.until:
Precisely what I was looking for. Thanks.
On 5/08/2014 10:03 a.m., TJB wrote:
On Monday, 4 August 2014 at 21:58:09 UTC, maarten van damme via
Digitalmars-d-learn wrote:
I am a little bit confused as to what you want.
There is a command line example at dlang.org, and there exists a program
(rdmd) that compiles several D files and runs
https://github.com/D-Programming-Language/phobos/pull/1910
Very interesting discussion, thanks. I'm impressed by the amount of
work you guys do on github.
42 matches
Mail list logo