Threadsafe project model

Esben Mose Hansen kde at mosehansen.dk
Fri Jul 16 11:18:02 UTC 2010


On Friday 16 July 2010 11:45:58 Andreas Pakulat wrote:
> Its not that easy. The parsing of the project is done in multiple
> threads (currently) and one step has to produce a list of items that are
> then used for the next iteration (if they're folder items). So the items
> need to exist as soon as the parse() method returns. 

Then I'd have a shared list of the items created. In fact, I'd create an objet 
for all the data that needs to be shared during parsing between the parser 
threads. This object could then have a suitable lock. Anything to avoid 
reading from a complicated QAbstractItemModel. 

Of course, whoever implements decides, I just think that this approach is 
safer and probably easier in the long run, though maybe not immediately.

-- 
kind regards, Esben




More information about the KDevelop-devel mailing list