Review request: control flow graph plugin

Sandro Andrade sandro.andrade at gmail.com
Wed Nov 25 03:55:32 UTC 2009


Hy guys,

Coming back to control flow graph. Apparently more time will be required to
fully analyse the questions about DU-Chain use and assure things are ok, so
I think it would be better to move it back to playground for a while, right ?

Sandro

On Tue, Nov 10, 2009 at 11:18 AM, David Nolden <zwabel at googlemail.com> wrote:
> Am Dienstag 10 November 2009 11:30:13 schrieb Esben Mose Hansen:
>> On Monday 09 November 2009 23:53:58 Andreas Pakulat wrote:
>> > Is there a mutex/lock in the code that protects the above assignment and
>> > the usage in the separate threads? If not that might be the reason, no
>> > code besides stuff in duchain is thread-safe in kdevelop. So it could
>> > very well be that the above assignment isn't done yet while another
>> > thread tries to access the variable.
>>
>> I didn't find any yesterday, so I really doubt it. Besides, even if there
>>  were, what were to prevent this scenario
>>
>> 1. Cursor is moved. Project (and duchain stuff) is assigned, thread_weaver
>> queue enqueued
>> 2. Project close/delete/otherwise invalidated
>> 3. thread weaver gets around to actually running the job
>>
>> Unless, of course, the threadweaver somehow knows about the projects and
>> ensures that they are appropriately canceled when this happens. Even with
>> this, I don't see how the DUChain pointers could survive from 1. to 3.
>
> It is safe to keep references to duchain objects across lock phases if:
> - They are held through a "DUChainPointer", "IndexedDeclaration", or
> "IndexedDUContext" object. In those cases however the objects will become zero
> if they were deleted+recreated by the background-parser in the meantime.
>
> So a better option would be either gathering the objects in the background-
> thread with a read-lock held, or referencing them through a DeclarationId
> object.
>
> Greetings, David
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>



-- 
Sandro Santos Andrade
--------------------------------------------------------
http://sandroandrade.wordpress.com
http://liveblue.wordpress.com
Distributed Systems Laboratory (LaSiD)
Computer Science Department (DCC)
Federal University of Bahia - Brazil
KDE developer - KDevelop project




More information about the KDevelop-devel mailing list