Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Several improvements to Code Completion plugin
Folco:
--- Quote from: ollydbg on January 04, 2014, 02:42:23 pm ---
--- Quote from: Folco on January 04, 2014, 02:14:31 pm ---And something like that :
--- Code: ---lock the tokentree
copy the token tree
release the tokentree
while (file queue not empty)
{
analysis / add symbol / fill queue with include directives, modifying copied_tokentree
lock the tokentree, update tokentree with copied_tokentree, then release it
}
--- End code ---
--- End quote ---
What does the above pseudo code used for? For parser?
--- End quote ---
Yes. First the parser create a copy, then it modifies its copy when parsing files, and once a file is parsed, it can update the token tree used by the GUI or other parts of CB.
--- Quote --- the copied tokentree are used for GUI?
--- End quote ---
No. It uses the TokenTree which is updated after each file by the parser thread.
--- Quote ---Note A Tokentree is a very big object, so copy tokentree takes a lot of time. So, it is a shared object, can either write or read at a time.
--- End quote ---
Ah. That is why my very first question was about the size of the token tree. Do you have any idea of the size in KB/MB ?
Of course, my idea would not be usable it the token tree was too big... The aim of what I propose is to avoid long periods of locking for the Token Tree.
ollydbg:
--- Quote from: Folco on January 04, 2014, 03:04:47 pm ---
--- Quote from: ollydbg on January 04, 2014, 02:42:23 pm ---Note A Tokentree is a very big object, so copy tokentree takes a lot of time. So, it is a shared object, can either write or read at a time.
--- End quote ---
Ah. That is why my very first question was about the size of the token tree. Do you have any idea of the size in KB/MB ?
Of course, my idea would not be usable it the token tree was too big... The aim of what I propose is to avoid long periods of locking for the Token Tree.
--- End quote ---
Thanks for all your reply.
A tokentree is very big, for example for a large project (Codeblocks.cbp), its size if about 100MByte or 200MByte or even bigger. ;D
Folco:
Erf :D Too large to perform a complete copy.
Nevertheless it could still be possible with a differential copy. I don't know if it would be a good solution, I never worked on such big data.
ollydbg:
--- Quote from: Folco on January 04, 2014, 03:29:48 pm ---Erf :D Too large to perform a complete copy.
Nevertheless it could still be possible with a differential copy. I don't know if it would be a good solution, I never worked on such big data.
--- End quote ---
What do you mean by "differential copy"?
Partial copy? I think partial copy of the tokentree is also not possible, because symbols in Tokentree are referenced each other.
Folco:
Sorry, my english is very bad. I think that : "push to TokenTree the parts of the modified TokenTree which have been modified". But this seems hard if symbols refers to other ones.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version