I got an idea that might just work
The reason we're having so many problems with code completion under linux is because of the parserthread class, right?
That's because the ParserThread carries all the information to parse a file.
Well, my idea is to SEPARATE this "parsing information" from the thread, encapsulating it into a single object:
ParserJob. The parserthread will be just a container.
This way, if we want to parse a small string, we don't need to create a new thread to parse. We'll just create a ParserJob, and ask it to parse.
Furthermore, with this model, we can create the Parser jobs in a queue (
ParseQueue ) and we'll feed them to whatever ParserThread is currently running. To handle an include, it'll just create a new parser job and add it to the queue (no meddling with wxwidgets events!
). And when the ParserThread finishes parsing, it just searches for a job which will parse the next file.
This way, we don't have to create 100 threads and delete them!
(I've ran it under linux gdb, the threads aren't deleted instanty, so you can imagine)
And I bet parsing will be a lot faster!
What do you think guys? Yiannis?