Socket.select interrupted system call because of GC

2013-08-02 Thread Marek Janukowicz
I have a program with one thread waiting on Socket.select call and another thread doing stuff causing GC to kick in. When this happens, Socket.select fails with "Interrupted system call". I found referenced to some old discussion and bug, but it seems to be long gone (I output SA_RESTART in my

Re: Socket.select interrupted system call because of GC

2013-08-03 Thread dennis luehring
Am 03.08.2013 08:38, schrieb Marek Janukowicz: void main () { writefln( "sa: %d", SA_RESTART ); (new Thread (&serverfunc)).start(); (new Thread (&clientfunc)).start(); } i have no idea to your main problem but firing threads without any join on the threads in your main program seems v

Re: Socket.select interrupted system call because of GC

2013-08-03 Thread Marek Janukowicz
dennis luehring wrote: > Am 03.08.2013 08:38, schrieb Marek Janukowicz: >> void main () >> { >>writefln( "sa: %d", SA_RESTART ); >>(new Thread (&serverfunc)).start(); >>(new Thread (&clientfunc)).start(); >> } > > i have no idea to your main problem but firing threads without any join

Re: Socket.select interrupted system call because of GC

2013-08-03 Thread dennis luehring
Am 03.08.2013 13:35, schrieb Marek Janukowicz: dennis luehring wrote: Am 03.08.2013 08:38, schrieb Marek Janukowicz: void main () { writefln( "sa: %d", SA_RESTART ); (new Thread (&serverfunc)).start(); (new Thread (&clientfunc)).start(); } i have no idea to your main problem but fir

Re: Socket.select interrupted system call because of GC

2013-08-03 Thread David Nadlinger
On Saturday, 3 August 2013 at 13:19:53 UTC, dennis luehring wrote: but you should not reduce your sample down to maybe-incorrect (what it seems for me in this case) - the join wouldn't make your sample to big The example given is correct, as druntime guarantees that non-daemon threads will ru

Re: Socket.select interrupted system call because of GC

2013-08-03 Thread Marek Janukowicz
David Nadlinger wrote: >> but you should not reduce your sample down to maybe-incorrect >> (what it seems for me in this case) - the join wouldn't make >> your sample to big > > The example given is correct, as druntime guarantees that > non-daemon threads will run to completion before the program

Re: Socket.select interrupted system call because of GC

2013-08-03 Thread David Nadlinger
On Saturday, 3 August 2013 at 15:59:30 UTC, Marek Janukowicz wrote: It's really nice to have some chat about the correctness of example code snippets, but can anyone help me with the original issue? :) Sorry, apparently I forgot to include the actual content:. ;) Socket.select is an ancient (

Re: Socket.select interrupted system call because of GC

2013-08-04 Thread Marek Janukowicz
David Nadlinger wrote: > See > https://github.com/apache/thrift/blob/master/lib/d/src/thrift/server/transport/socket.d#L144 > for a production-tested implementation. When I wrote that code, > it wasn't possible to do this in a platform-independent way using > std.socket (see > https://github.com/