Re: A few remarks about locking



On 2002.03.26 12:44:08 +0000 Emmanuel wrote:
> On 26.03.2002 09:42 Pawel Salek wrote:
>> On 2002.03.25 16:54 Emmanuel wrote:
>>> It's written in a comment before the function 
>>> libbalsa_mailbox_load_messages(LibBalsaMailbox * mailbox) (in 
>>> libbalsa/mailbox.c) that it must be called with the gdk lock held. But I

>> Just remember that the signal handlers may call GDK functions.
> 
> Yes you're right.
> But if you look at libbalsa_mailbox_load_messages, the big loop does not 
> call gtk (AFAICS) so we could release the lock before it and reclaim it 
> after. I think this improves a bit the UI interactivity for huge mailboxes.

true, seems like we could safely drop the gdk lock till we emit MESSAGES_NEW.
pawel ?

>> 
> OK but a concurrent call to libmutt could change the datas referenced by 
> the context. So for example you could have you context saying that you have 
> 100 messages, then you go for the loop and in the meantime another thread 
> call libmutt and delete one of the messages and you will try to access a 
> header that no more exists. That sounds possible at least to me.

you may have a point here. when we grab the mutt lock do we automagically
lock the mailboxes ? looking a lock_mutt and LOCK_MAILBOX it doesn't seem like
it. am i missing something ?



-- 
Carlos Morgado - chbm(at)chbm(dot)nu - http://chbm.nu/ -- gpgkey: 0x1FC57F0A
http://wwwkeys.pgp.net/ FP:0A27 35D3 C448 3641 0573 6876 2A37 4BB2 1FC5 7F0A
Software is like sex; it's better when it's free. - Linus Torvalds



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