HighTechTalks DotNet Forums  

Using threads in vb.net framework 1.1

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Using threads in vb.net framework 1.1 in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Colette_J
 
Posts: n/a

Default Using threads in vb.net framework 1.1 - 06-04-2007 , 11:09 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




Reply With Quote
  #2  
Old   
Spam Catcher
 
Posts: n/a

Default Re: Using threads in vb.net framework 1.1 - 06-05-2007 , 01:04 PM






"Colette_J" <papow (AT) yahoo (DOT) com> wrote in
news:ussF0prpHHA.1216 (AT) TK2MSFTNGP03 (DOT) phx.gbl:

Quote:
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?

Yes, you can pause a thread.

Take a look at ManualResetEvents.



Reply With Quote
  #3  
Old   
ThunderMusic
 
Posts: n/a

Default Re: Using threads in vb.net framework 1.1 - 06-05-2007 , 04:02 PM



"Colette_J" <papow (AT) yahoo (DOT) com> wrote

Quote:
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



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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.