[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-devel] Progress update on multi-threading of pan uudecode code

From: Calin A. Culianu
Subject: Re: [Pan-devel] Progress update on multi-threading of pan uudecode code
Date: Tue, 20 Mar 2007 05:56:53 -0400 (EDT)

Sounds like you have taken the more complicated approach of creating a
new type of task.  From my reading of the code, a few changes to
task-article are all that would be required.  Add one or two functions
to the class, make the decode function queue the data to the worker
thread and add the other required bits.

I didn't create a new type of task, I merely added a couple of new states to the existing task. I actually had a bug somewhere else where it was making the remove calls not work (the logic for deciding if a task is active was faulty). That's fixed now.

Anyway, yeah, essentially I just added a bit of code to the task-article.

One of the cases you may have missed is that the gui can't be safely
updated from the worker thread.  This means that error logging  is a

Heh, what do you take me for, a novice?  ;)

Of course I am not updating the GUI from another thread -- that would be impossible on most platforms as GUI updates should only happen from the main thread, as per GTK+ specs. On X it crashes programs. That's a pretty basic thing to know.. ;)

There is a polling timer function that runs as a GSource function and it periodically locks a mutex, takes some status data, and unlocks a mutex and gives the data to the GUI. This polling function runs in the main thread, of course. This status data is necessary so the GUI can tell the user what the progress of the decode is.

Anwyay my changes are done and I am quite happy with them. I still need to clean some things up in terms of elegance/readability but if anyone wants I can upload the sources I have to my webserver and provide a URL to the mailing list so you guys can d/l and test. Or I can provide a patch against the latest SVN. Whatever works for you guys.

Anyone want to test it?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]