www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DCD as a library - stops working after some thread is created.

reply Vadim Lopatin <coolreader.org gmail.com> writes:
I'm using DCD as a library in DlangIDE.
All DCD calls are made from separate thread.
DCD works ok until some thread is created (e.g. to invoke DUB for 
building).
After this operation DCD stops working correctly and can locate 
symbols only from current source file.

Root cause:
If some another thread is created after DCD thread instantiated 
ModuleCache, DCD is not able to process goToDefinition for symbol 
and other functions if they are related to other modules than 
current source file.
Probably, it's related to ModuleCache and/or allocators.

Steps to reproduce:
After creation of ModuleCache, start some thread and wait until 
it's finished.


Does someone know some workaround?


Filed DCD issue 407.

DCD stops working if some thread is created after instantiation 
of ModuleCache

https://github.com/dlang-community/DCD/issues/407
Aug 11 2017
parent Vadim Lopatin <coolreader.org gmail.com> writes:
On Friday, 11 August 2017 at 08:17:32 UTC, Vadim Lopatin wrote:
 I'm using DCD as a library in DlangIDE.
 All DCD calls are made from separate thread.
 DCD works ok until some thread is created (e.g. to invoke DUB 
 for building).
/// call this function after DCD ModuleCache is instantiated to reproduce issue void testDCDFailAfterThreadCreation() { import core.thread; Thread thread = new Thread(delegate() { Thread.sleep(dur!"msecs"(2000)); }); thread.start(); thread.join(); }
Aug 11 2017