Re: Balsa git master consumes 100% CPU

Peter Bloomfield <[email protected]> Tue, 14 Jan 2020 15:21:50 -0500
Newsgroups gmane.comp.gnome.apps.balsa
Message-ID <[email protected]>
Hi Albrecht!

On 01/14/2020 01:44:00 PM Tue, Albrecht Dreß wrote:
> Hi all,
> 
> since the latest updates of master I observe that Balsa /sometimes/ after startup consumes 100% CPU, and does show nothing in the open mailbox tabs.  I could reproduce the issue in gdb (see below); the thread consuming the 100% CPU load is the main one (thread 1).  It is still possible to regularly terminate Balsa by clicking the main window close button (but File -> Quit does nothing).  I *think* this error was introduced last Sunday (Jan. 12, 2020), maybe with commit  e556a72068b2f9eb4acf0d56cf33f3eaedc0a522?
> 
> Any idea what is happening here?
> 
> Cheers, Albrecht.

Apparently an idle handler that was tasked with completing the load of a mailbox was being constantly rescheduled. Weirdly, it was only for an empty mailbox--loading a mailbox with messages caused no problem!

That part of the code handles scrolling to an appropriate message. An empty mailbox doesn't have any message to scroll to on opening, so I just put in some code to bypass it; works for me right now without hogging the cpu. Just pushed to GitLab.

I'm trying to move the time-consuming stuff to threads, to make the UI more responsive, and perhaps even make the progress bar move again when setting the fraction of a task completed. I also want to look into using a GThreadPool[0], to make a limited number of additional threads available for the initial opening of mailboxes.

Best,  Peter

[0] https://developer.gnome.org/glib/stable/glib-Thread-Pools.html

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQS030wPRfNNA5alz3MfX9S1uSp09QUCXh4i3gAKCRAfX9S1uSp0
9XZtAJ4xFThsvlU7ztQW4QmHtYQve5rQ/ACeP9wxfRcnvW8ksjEAS/2Ssg13HdY=
=ZY02
-----END PGP SIGNATURE-----