[Debtags-devel] Any Idea why this fails?
Benjamin Mesing
bensmail@gmx.net
Mon, 13 Sep 2004 21:18:10 +0200
Hello
> Uhm... multiple times as in:
> while (1)
> {
> Tagcoll::InputMerger<int, string> merger;
> Tagcoll::TagcollBuilder collBuilder(*(new Tagcoll::HandleMaker<string>()));
> // load the database into the collBuilder and change it to handles
> Debtags::TagDB::outputSystem(collBuilder, false);
> }
This does definetely work (at least doing it twice).
> or multiple times as in:
> while (1)
> {
> exec in new thread {
> Tagcoll::InputMerger<int, string> merger;
> Tagcoll::TagcollBuilder collBuilder(*(new Tagcoll::HandleMaker<string>()));
> // load the database into the collBuilder and change it to handles
> Debtags::TagDB::outputSystem(collBuilder, false);
> }
> }
> ?
For the failing case I am not completely sure as I work with the QT
which is multithreaded. But I think it happens from a single thread. The
request is triggered asynchron (by user interaction) which might come
from another thread. I do not know above about QT internals and threads
to be sure of it.
I would have hoped that the failing only in the latest version would
have hinted towards the problem.
> Design note: now that we have autodebtag I was considering moving
> expansion of derived tags into autodebtag, and just loading the system
> database "as is". This would really help efficiency: for example, you
> could mmap the file, or add an index pointing to where the tags for a
> given package are in the text file.
Hmm.. I never cared for such low level stuff as mmap and was scared by
it from libapt, but I am sure you will provide a nice object oriented
interface for it :-)
But I would really like this as this would also trim down the memory
usage.
Greetings Ben