Are Fibers just broken in D?

Steven Schveighoffer schveiguy at yahoo.com
Fri Apr 20 20:46:20 UTC 2018


On 4/20/18 2:58 PM, Byron Moxie wrote:
> I am working on an application that makes heavy use of Fibers pools that 
> are processed by a thread pool.
> 
> In WIN32 it looks like its leaking memory then it segfaults (I am 
> guessing its an OOM).
> 
> I am also trying to use Semaphores and/or Conditions on shared data 
> between fibers, which results in segfaults as well.
> 
> atomicLoad and atomicStore are not working either.
> 
> Are Fibers usable at all?  Cause it doesn't seem like.  I already 
> re-arched this application to remove vibe.d (was fighting all sorts of 
> sync and event errors)
> 
> This application is turning into my last straw for D..  I spend about 
> 90% of my time fighting the compiler / library. I am really debating 
> re-writing this application in c++ over the weekend (I have already lost 
> money on this job after convincing by boss that D would be better).

It sounds like the problems may be due to Win32 and not the other 
pieces. Have you tried on a Win64 build? Even if that's not your target, 
at least it can help you discover whether that is the problem or not. 
The DMC runtime is the default on Win32, and it's not especially 
thread-safe in all places.

FWIW, I'm using vibe.d on Linux 64 bit with no problems (and I've NEVER 
heard of atomicLoad and atomicStore not working on any arch).

-Steve


More information about the Digitalmars-d-learn mailing list