_getmaxstdio / _setmaxstdio
Missing _getmaxstdio / _setmaxstdio? I'd like to try and increase the limit of open files without resorting to Windows API, is it possible or will I have to resort to the WinAPI to achieve this? Thanks Damian
Re: Fastest Way to Append Multiple Elements to an Array
On Friday, 26 December 2014 at 16:31:48 UTC, Nordlöw wrote: On Friday, 26 December 2014 at 16:29:56 UTC, Nordlöw wrote: See my update at https://github.com/nordlow/justd/blob/master/algorithm_ex.d#L1602 which tries to merge all the ideas into one adapting algorithm :) Destroy! BTW: 1. Is is relevant to extend `append` to data being a non-Random-Access range? 2. I guess a corresponding `prepend` is motivated aswell, right? Append and Prepend would be very useful additions to Phobos it's quite surprising there not already there? In any case would love to see some pull requests :)
Re: Problems with Mutex
On Sunday, 26 October 2014 at 22:14:25 UTC, Neven wrote: I'm trying to use Mutex from core.sync.mutex; but when I try to initialize it at compile time this error pops up: Error: constructor core.sync.mutex.Mutex.this core.sync.mutex.Mutex cannot be constructed at compile time, because the constructor has no available source code So I try to initialize it at run time but whenever I use that mutex in code (via synchronized blocks) I get segmetation faults (SIGSEGV). Code here: http://pastebin.com/Z8Yj2kwY Try __gshared Mutex mutex;
Re: Problems with Mutex
On Sunday, 26 October 2014 at 22:53:09 UTC, Neven wrote: On Sunday, 26 October 2014 at 22:21:17 UTC, Damian wrote: On Sunday, 26 October 2014 at 22:14:25 UTC, Neven wrote: I'm trying to use Mutex from core.sync.mutex; but when I try to initialize it at compile time this error pops up: Error: constructor core.sync.mutex.Mutex.this core.sync.mutex.Mutex cannot be constructed at compile time, because the constructor has no available source code So I try to initialize it at run time but whenever I use that mutex in code (via synchronized blocks) I get segmetation faults (SIGSEGV). Code here: http://pastebin.com/Z8Yj2kwY Try __gshared Mutex mutex; Thanks, that works now; but why? Why cannot I globally have auto mutex = new Mutex? And why it works now when I put __gshared? You can use auto mutex = cast(shared)(new Mutex());
Re: Problems with Mutex
On Sunday, 26 October 2014 at 22:53:09 UTC, Neven wrote: On Sunday, 26 October 2014 at 22:21:17 UTC, Damian wrote: On Sunday, 26 October 2014 at 22:14:25 UTC, Neven wrote: I'm trying to use Mutex from core.sync.mutex; but when I try to initialize it at compile time this error pops up: Error: constructor core.sync.mutex.Mutex.this core.sync.mutex.Mutex cannot be constructed at compile time, because the constructor has no available source code So I try to initialize it at run time but whenever I use that mutex in code (via synchronized blocks) I get segmetation faults (SIGSEGV). Code here: http://pastebin.com/Z8Yj2kwY Try __gshared Mutex mutex; Thanks, that works now; but why? Why cannot I globally have auto mutex = new Mutex? And why it works now when I put __gshared? Globally you can use: Mutex mutex; static this() { mutex = new Mutex(); }