Re: I'm porting some go code to D

2013-09-20 Thread Sean Kelly
On Aug 24, 2013, at 1:59 AM, David d...@dav1d.de wrote: Daemonic Threads often end with a segfault, so if your main thread exists, the other threads will probably segfault. By default, sure. But with daemon threads you really want to have some kind of shutdown mechanism inside a static dtor

Re: I'm porting some go code to D

2013-09-18 Thread Rory McGuire
I've made the scheduler a bit more inteligent and the channel implementation is now backed by a lock free queue. https://github.com/rjmcguire/goport/blob/tip/wrapper2.d for a example using libev https://github.com/rjmcguire/goport/blob/tip/goroutine.d for the go routines

Re: I'm porting some go code to D

2013-08-25 Thread Rory McGuire
On 24 Aug 2013 23:55, Paulo Pinto p...@progtools.org wrote: Funny, I always thought otherwise, because Windows only has threads. Processes are just a means of grouping threads on Windows, as there isn't the distinction between threads and processes that UNIX systems used to make. Then

Re: I'm porting some go code to D

2013-08-25 Thread Rory McGuire
On Sat, Aug 24, 2013 at 3:26 PM, bearophile bearophileh...@lycos.comwrote: David Nadlinger: It's a cute idea, but not really practical, I'm afraid – Goroutines are managed by a scheduler in the Go runtime library, whereas D threads directly map to OS threads. Can't Rory McGuire add a

Re: I'm porting some go code to D

2013-08-25 Thread Timon Gehr
On 08/26/2013 12:55 AM, Rory McGuire wrote: shared chan!Fiber scheduler; // channel contains Fibers waiting for their time slice static this () { if (scheduler is null) { You want 'shared static this' instead to avoid a race condition.

Re: I'm porting some go code to D

2013-08-25 Thread Rory McGuire
Awesome thanks, thought what I did there was dodgy. It was really weird when this() started multiple schedulers at least now I see the obvious reason. BTW: gist is at: https://gist.github.com/rjmcguire/6336931 Could someone point me at the correct linked list to use inside the channel. I'd

Re: I'm porting some go code to D

2013-08-24 Thread Rory McGuire
On 24 Aug 2013 03:15, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Friday, 23 August 2013 at 23:54:55 UTC, Rory McGuire wrote: So I'm porting so #golang code to #dlang and there is all these blasted go statements.So I thought I'd give implmenting it in D a shot. What do you guys

Re: I'm porting some go code to D

2013-08-24 Thread David
Daemonic Threads often end with a segfault, so if your main thread exists, the other threads will probably segfault.

Re: I'm porting some go code to D

2013-08-24 Thread Rory McGuire
On 24 Aug 2013 11:00, David d...@dav1d.de wrote: Daemonic Threads often end with a segfault, so if your main thread exists, the other threads will probably segfault. Thanks, I wonder what they're accessing that they shouldn't.

Re: I'm porting some go code to D

2013-08-24 Thread Moritz Maxeiner
On Friday, 23 August 2013 at 23:54:55 UTC, Rory McGuire wrote: So I'm porting so #golang code to #dlang and there is all these blasted go statements.So I thought I'd give implmenting it in D a shot. What do you guys think? Fire away :). /** * chan allows messaging between threads without

Re: I'm porting some go code to D

2013-08-24 Thread David Nadlinger
On Friday, 23 August 2013 at 23:54:55 UTC, Rory McGuire wrote: So I'm porting so #golang code to #dlang and there is all these blasted go statements.So I thought I'd give implmenting it in D a shot. What do you guys think? It's a cute idea, but not really practical, I'm afraid – Goroutines

Re: I'm porting some go code to D

2013-08-24 Thread bearophile
David Nadlinger: It's a cute idea, but not really practical, I'm afraid – Goroutines are managed by a scheduler in the Go runtime library, whereas D threads directly map to OS threads. Can't Rory McGuire add a scheduler to his code? How much code does it take? Bye, bearophile

Re: I'm porting some go code to D

2013-08-24 Thread Rory McGuire
On 24 Aug 2013 11:25, Moritz Maxeiner mor...@ucworks.org wrote: On Friday, 23 August 2013 at 23:54:55 UTC, Rory McGuire wrote: So I'm porting so #golang code to #dlang and there is all these blasted go statements.So I thought I'd give implmenting it in D a shot. What do you guys think? Fire

Re: I'm porting some go code to D

2013-08-24 Thread Jonas Drewsen
On Saturday, 24 August 2013 at 13:26:32 UTC, bearophile wrote: David Nadlinger: It's a cute idea, but not really practical, I'm afraid – Goroutines are managed by a scheduler in the Go runtime library, whereas D threads directly map to OS threads. Can't Rory McGuire add a scheduler to his

Re: I'm porting some go code to D

2013-08-24 Thread Rory McGuire
On Sat, Aug 24, 2013 at 3:26 PM, bearophile bearophileh...@lycos.comwrote: David Nadlinger: It's a cute idea, but not really practical, I'm afraid – Goroutines are managed by a scheduler in the Go runtime library, whereas D threads directly map to OS threads. Can't Rory McGuire add a

Re: I'm porting some go code to D

2013-08-24 Thread Paulo Pinto
On Saturday, 24 August 2013 at 20:03:58 UTC, Rory McGuire wrote: On Sat, Aug 24, 2013 at 3:26 PM, bearophile bearophileh...@lycos.comwrote: David Nadlinger: It's a cute idea, but not really practical, I'm afraid – Goroutines are managed by a scheduler in the Go runtime library, whereas D

Re: I'm porting some go code to D

2013-08-23 Thread Jesse Phillips
On Friday, 23 August 2013 at 23:54:55 UTC, Rory McGuire wrote: So I'm porting so #golang code to #dlang and there is all these blasted go statements.So I thought I'd give implmenting it in D a shot. What do you guys think? Fire away :). I'd suggest posting long snippets of code to