Re: DMD Backend: Deciding instructions to use/avoid?

2011-06-09 Thread Nick Sabalausky
"Bernard Helyer" wrote in message news:isdgdc$m3a$1...@digitalmars.com... > If you run the program in GDB, can you disassemble when the error is > given? That may give you the instruction the kernel is assasinating your > process for. I can try that if anyone can help walk me through it or at le

Re: DMD Backend: Deciding instructions to use/avoid?

2011-06-09 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:isoltk$1ehd$1...@digitalmars.com... > "Don" wrote in message > news:isoh6c$15jb$1...@digitalmars.com... >> Nick Sabalausky wrote: >>> So my main question: Does DMD do anything like, say, detecting the CPU >>> at compile time and then enabling instruction

Re: How to avoid running out of OS thread handles when spawning lots of short-lived threads?

2011-06-09 Thread Steven Schveighoffer
On Thu, 09 Jun 2011 19:57:27 -0400, David Nadlinger wrote: On 6/10/11 1:37 AM, Steven Schveighoffer wrote: t.join() ? http://www.digitalmars.com/d/2.0/phobos/core_thread.html#join Doesn't work, in my application I'm a) using std.concurrency, and b) even that is hidden behind the API I wan

Re: How to avoid running out of OS thread handles when spawning lots of short-lived threads?

2011-06-09 Thread David Nadlinger
On 6/10/11 1:37 AM, Steven Schveighoffer wrote: t.join() ? http://www.digitalmars.com/d/2.0/phobos/core_thread.html#join Doesn't work, in my application I'm a) using std.concurrency, and b) even that is hidden behind the API I want to test. A better example would probably be the following, whi

Re: How to avoid running out of OS thread handles when spawning lots of short-lived threads?

2011-06-09 Thread Steven Schveighoffer
On Thu, 09 Jun 2011 19:17:28 -0400, David Nadlinger wrote: The title says it all – how can I avoid running out of OS thread handles when spawning lots of short-lived threads? In reality, I encountered the issue while writing tests a piece of code which spawns a thread, but this is the ba

Re: How to avoid running out of OS thread handles when spawning lots of short-lived threads?

2011-06-09 Thread David Nadlinger
On 6/10/11 1:21 AM, Robert Clipsham wrote: As far as I'm aware, you cannot avoid it, it's a hard coded limit set by the operating system. May I suggest using Fibers instead of threads? If your threads are short lived, their overhead is probably not worth it. You can also combine fibers with threa

Re: How to avoid running out of OS thread handles when spawning lots of short-lived threads?

2011-06-09 Thread Robert Clipsham
On 10/06/2011 00:17, David Nadlinger wrote: The title says it all – how can I avoid running out of OS thread handles when spawning lots of short-lived threads? In reality, I encountered the issue while writing tests a piece of code which spawns a thread, but this is the basic issue: --- import

How to avoid running out of OS thread handles when spawning lots of short-lived threads?

2011-06-09 Thread David Nadlinger
The title says it all – how can I avoid running out of OS thread handles when spawning lots of short-lived threads? In reality, I encountered the issue while writing tests a piece of code which spawns a thread, but this is the basic issue: --- import core.thread; void doNothing() {} void mai

Re: Careful when using chdir inside a dirEntries loop

2011-06-09 Thread Andrej Mitrovic
Ok filed. I don't know whether it's a bug or not, I do think it's a subtle issue worth investigating though.

Re: Careful when using chdir inside a dirEntries loop

2011-06-09 Thread Jonathan M Davis
On 2011-06-09 15:20, Andrej Mitrovic wrote: > Here's a little buggy code which most often throws an exception: > > foreach (string entry; dirEntries(curdir, SpanMode.shallow)) > { > if (entry.isdir) > { > foreach (string subentry; dirEntries(entry, SpanMode.shallow)) > { > if (subentry.isdir) > {

Careful when using chdir inside a dirEntries loop

2011-06-09 Thread Andrej Mitrovic
Here's a little buggy code which most often throws an exception: foreach (string entry; dirEntries(curdir, SpanMode.shallow)) { if (entry.isdir) { foreach (string subentry; dirEntries(entry, SpanMode.shallow)) { if (subentry.isdir)

Re: GTKD doesn't work too

2011-06-09 Thread Mike Wey
On 06/09/2011 07:43 PM, Fabian wrote: rd to your answers and I hope you can help me. Greetings Fabian Could you also post the verbose output? -- Mike Wey

Re: Convert TickDuration to Duration?

2011-06-09 Thread Steven Schveighoffer
On Thu, 09 Jun 2011 14:24:55 -0400, Jonathan M Davis wrote: On 2011-06-09 10:58, Steven Schveighoffer wrote: On Thu, 09 Jun 2011 13:33:28 -0400, Jonathan M Davis wrote: >> On 09.06.2011 16:33, Steven Schveighoffer wrote: >> > Hm... this involves cast(Duration)x? That seems like a dangero

Re: Convert TickDuration to Duration?

2011-06-09 Thread Jonathan M Davis
On 2011-06-09 10:58, Steven Schveighoffer wrote: > On Thu, 09 Jun 2011 13:33:28 -0400, Jonathan M Davis > > wrote: > >> On 09.06.2011 16:33, Steven Schveighoffer wrote: > >> > Hm... this involves cast(Duration)x? That seems like a dangerous thing > >> > for a common operation, no? > > > > There'

Re: Convert TickDuration to Duration?

2011-06-09 Thread Andrej Mitrovic
On 6/9/11, Steven Schveighoffer wrote: > What I mean is, whenever you use the blunt instrument 'cast' anything can > happen. This code: > > cast(x)y; > > can do a lot of damage, depending on what x and y are. This was on my mind since I've seen it in std.datetime, and I agree. Isn't it possible

Re: Convert TickDuration to Duration?

2011-06-09 Thread Steven Schveighoffer
On Thu, 09 Jun 2011 13:33:28 -0400, Jonathan M Davis wrote: On 09.06.2011 16:33, Steven Schveighoffer wrote: > Hm... this involves cast(Duration)x? That seems like a dangerous thing > for a common operation, no? There's nothing dangerous about it. It's an overloaded opCast, not a built-in

GTKD doesn't work too

2011-06-09 Thread Fabian
Hi I've got already experience with Delphi so I want to start learning D using a GUI library. I've already tried to install DWT2 but the installation failed and so I decided to try out GTKD. It's no problem to build and install GTKD using dsss but when I try to build a sample app I get the fol

Re: Convert TickDuration to Duration?

2011-06-09 Thread Jonathan M Davis
On 2011-06-09 08:18, simendsjo wrote: > On 09.06.2011 16:33, Steven Schveighoffer wrote: > > On Wed, 08 Jun 2011 18:02:40 -0400, Jonathan M Davis > > > > wrote: > >> On 2011-06-08 14:30, David Nadlinger wrote: > >>> On 6/8/11 11:14 PM, Jonathan M Davis wrote: > >>> > On 2011-06-08 13:36, David Na

Re: ? toString(?)

2011-06-09 Thread Jonathan M Davis
On 2011-06-09 08:38, simendsjo wrote: > Object contains toString as the following: > string toString(); > > But there are also other versions going about: > void toString(void delegate(const(char)[]) sink, string fmt); > void toString(void delegate(const(char)[]) sink, FormatSpec fmt); > > I woul

? toString(?)

2011-06-09 Thread simendsjo
Object contains toString as the following: string toString(); But there are also other versions going about: void toString(void delegate(const(char)[]) sink, string fmt); void toString(void delegate(const(char)[]) sink, FormatSpec fmt); I wouldn't be surprised to see some range based version too

Re: Convert TickDuration to Duration?

2011-06-09 Thread simendsjo
On 09.06.2011 16:33, Steven Schveighoffer wrote: On Wed, 08 Jun 2011 18:02:40 -0400, Jonathan M Davis wrote: On 2011-06-08 14:30, David Nadlinger wrote: On 6/8/11 11:14 PM, Jonathan M Davis wrote: > On 2011-06-08 13:36, David Nadlinger wrote: >> Did I miss a way to convert a TickDuration to a

Re: Install DWT2 using DMD and Tango

2011-06-09 Thread Fabian
I decided to use gtkD but I would be very glad if anybody is able to solve my problem.

Re: Convert TickDuration to Duration?

2011-06-09 Thread Steven Schveighoffer
On Wed, 08 Jun 2011 18:02:40 -0400, Jonathan M Davis wrote: On 2011-06-08 14:30, David Nadlinger wrote: On 6/8/11 11:14 PM, Jonathan M Davis wrote: > On 2011-06-08 13:36, David Nadlinger wrote: >> Did I miss a way to convert a TickDuration to a Duration? If there >> really is none, is there

Re: Is it reasonable to learn D

2011-06-09 Thread Kagamin
Trass3r Wrote: > >> http://h3.gd/code/nucleus/ > > > > I lol'd at the suggestion to upgrade my FF4 to a modern HTML5-compliant > > browser. > > ^^ No problems with Opera. I mean, it's ok that it doesn't work, it's just diagnostic message is wrong.

Re: Install DWT2 using DMD and Tango

2011-06-09 Thread Fabian
On 08.06.2011 23:57, Jesse Phillips wrote: Andrew Wiley Wrote: On Wed, Jun 8, 2011 at 11:54 AM, Fabian wrote: Hi I'm trying to install DWT2 to create GUI applications with D. I have downloaded DWT2 with TortoiseHg already and I've installed Ruby and Rake. But when I try to build the packages