[MonoDevelop] Proposed patch for bug 336368

Marcos Marín marcosmarin at gmail.com
Wed Oct 31 20:59:25 EDT 2007


On 10/30/07, Marcos Marín <marcosmarin at gmail.com> wrote:
>
>
>
> On 10/30/07, Lluis Sanchez <lluis at ximian.com> wrote:
> >
> > Hi,
> >
> > Using a queue and a single thread for generating the tag database is an
> > improvement. However, as Michael pointed out, the thread only needs to
> > exist when there is something in the queue. It should work more or less
> > like this:
> >
> >       * UpdateFileTags adds a new job to the queue. If the parser thread
> >         is not running start it.
> >       * The parser thread does all jobs of the queue until it is empty,
> >         and then dies.
> >
> > Also, there is something fundamentally incorrect about when projects are
> > parsed. The OnNodeAdded virtual method in ProjectNodeBuilderExtension is
> > not the right place for start parsing files. This method is called when
> > a project is shown in the tree, which is not the same as the project
> > being added to the solution. OnNodeAdded will be called every time the
> > tree is refreshed. This is a GUI event, not a data model event. You
> > should use the events provided by IdeApp.ProjectOperations, such as
> > EntryAddedToCombine, FileAddedToProject, FileChangedInProject...
> >
> > Lluis.
>
>
>
> Ok, I'll work on this today and send a corrected patch later today or
> tomorrow.
>
> El dl 29 de 10 del 2007 a les 18:31 -0600, en/na Marcos Marín va
> > escriure:
> > > The attached patch fixes bug 336368[1]. It moves all the threading
> > > from ProjectNodeBuilderExtension to TagDatabaseManager, the
> > > UpdateFileTags now only enqueues the file and a thread running in the
> > > background constantly checks the queue for new jobs every second.
> > >
> > > Would appreciate some feedback and whether it is ok for me to commit
> > > and mark the bug as resolved.
> > >
> > > [1]https://bugzilla.novell.com/show_bug.cgi?id=336368
> > > _______________________________________________
> > > Monodevelop-list mailing list
> > > Monodevelop-list at lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/monodevelop-list
> >
> >
>
Sorry it took so long, but I have finally done the suggested changes.

About thread safety, for the passed project only the Equals method is
called, no information of any kind is changed so I think it is thread safe,
but I'm really not all that confident about my concurrency programming
skills. And about the tag database manipulation, the database is written and
read by the same thread, which is now in a queue so I don't think there
would be a problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20071031/973cd088/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parsing.diff
Type: text/x-diff
Size: 31051 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20071031/973cd088/attachment-0001.bin 


More information about the Monodevelop-list mailing list