Hey guys,
Im working on my plugin and i need a little help
I have a Queue with objects that need to get processed.. I have a function that adds the items to the queue... But i want to know the best way to if Queue.Count > 0 do something
I had a thread that would contuinious check the queue, but that is not the way to do it since it puts a load on the CPU.
Second i had the thread goto sleep and once i called enqueue it would wake up the thread, process and then go back to sleep, but for something reason i think they may break if there is alot of activity in the queue or go into a deadlock state.
I was wondering if there is a better method, i tried making an event but i dont quite know the syntax on making a custom event in vb.net VS2008, i feel this is the best way but i dont quite know how...
Any ideas?
Thanks
-Tom-
Im working on my plugin and i need a little help
I have a Queue with objects that need to get processed.. I have a function that adds the items to the queue... But i want to know the best way to if Queue.Count > 0 do something
I had a thread that would contuinious check the queue, but that is not the way to do it since it puts a load on the CPU.
Second i had the thread goto sleep and once i called enqueue it would wake up the thread, process and then go back to sleep, but for something reason i think they may break if there is alot of activity in the queue or go into a deadlock state.
I was wondering if there is a better method, i tried making an event but i dont quite know the syntax on making a custom event in vb.net VS2008, i feel this is the best way but i dont quite know how...
Any ideas?
Thanks
-Tom-
Comment