Queue Object

Does anyone have any examples of using a queue object with multiple threads? I want to load a que with strings that point to files and I would like threads to retrieve a string from the que and process it (this would continue till the que were empty). I can generate a couple of threads, but I don't know how to get them to interact with a queue. What I am doing is splitting up the strings so that each thread gets an equal amount and can work from there without having to access any type of structure.
Any ideas?
[526 byte] By [fenris] at [2008-2-23]
# 1
Hi Fenris,

Yasser wrote a good article on Threading a while ago that you should check out:
http://msdn.microsoft.com/msdnmag/issues/01/07/vbnet/default.aspx

The key idea is to use a ThreadPool object and use it's QueUserWorkItem method to store several calls to methods that will do the actual work. It's a good idea to queue up calls to methods that *do the work* b/c this is where your app is spending it's time. In other words, you don't want to create a new thread every time you receive a MSMQ message.

If you need more help or examples, please let me know.

Best,
Paul Yuknewicz
Visual Basic

PaulYuk_MS at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...