I've got a sort of spell checker written in Delphi. It analyzes the text sentence by sentence. It encolors wrong items according to some rules after parsing each sentence. The user is able to interrupt this process, which is important. How can I parallelize this process in general using some 3rd party Delphi libraries? In the current state I've got on the fly sentence coloration after check. Thus the user sees the progress.
The algorithm would be as such:
How the multiple spell-checkers will access the dictionary is another problem. You can load a copy of the dictionary in each worker or you can protect access to the dictionary with a lock (but that would slow things down). If you are lucky, dictionary is thread-safe for reading and you can do simultaneous queries without locking.
Appropriate OmniThreadLibrary abstraction for the problem would be either a ParallelTask or a BackgroundWorker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With