Groups | Blog | Home
all groups > dotnet remoting > june 2007 >

dotnet remoting : Using threads in vb.net framework 1.1


Colette_J
6/4/2007 10:09:45 AM
Not sure if this is the best group for the posting, but hopefully someone
can point me in the right direction. I'm firing a thread which populates a
hash table of objects, can I at any point suspend the thread and traverse
(work) the hash table for an object and then continue the thread once
complete with my traversal?



Colette


ThunderMusic
6/5/2007 4:02:25 PM
[quoted text, click to view]
Hi,
I think you can try this :

private void ThreadProc()
{
while (...)
{
lock(m_HashTable)
{
m_HashTable.add(...);
}
}
}

private void OtherMethod(...)
{
lock(m_HashTable)
{
' While m_HashTable is locked, the thread will be blocked
' and will continue as soon as you release the lock
}
}

I hope it helps

ThunderMusic

Spam Catcher
6/5/2007 5:04:27 PM
"Colette_J" <papow@yahoo.com> wrote in
news:ussF0prpHHA.1216@TK2MSFTNGP03.phx.gbl:

[quoted text, click to view]

Yes, you can pause a thread.

Take a look at ManualResetEvents.
AddThis Social Bookmark Button