I have never used threads–never thought my code would benefit. However, I think threading might improve performance of the following pseudo code:
Loop through table of records containing security symbol field and a quote field
Load a web page (containing a security quote for a symbol) into a string variable
Parse the string for the quote
Save the quote in the table
Get next record
end loop
Loading each web page takes the most time. Parsing for the quote is quite fast. I guess I could take, say, half the records for one thread and work the other half in a second thread.
In OmniThreadLibrary it is very simple to solve this problem with a multistage pipeline – first stage runs on multiple tasks and downloads web pages and second stage runs in one instance and stores data into the database. I have written a blog post documenting this solution some time ago.
The solution can be summed up with the following code (you would have to fill in some places in HttpGet and Inserter methods).