By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

Mutex help

P: n/a
hi all
I have one problem in vb.net application.
I am having two threads which are starting at the same time.
Both these threads are reading one file and retrieving data from same
file.
When one thread start and during retrieving information from file, if i
abort thread then second thread is getting affected and is going to
infinite loop.

To allow only one thread to get access to file, should i use mutex
before starting actual reading of file.
Is it correct way. Please tell me when should i use mutex.
Please help me.

Thanks in advance.

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Take a look a synclock
http://msdn.microsoft.com/library/de...tmsynclock.asp

Ken
-----------------
<tr**************@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
hi all
I have one problem in vb.net application.
I am having two threads which are starting at the same time.
Both these threads are reading one file and retrieving data from same
file.
When one thread start and during retrieving information from file, if i
abort thread then second thread is getting affected and is going to
infinite loop.

To allow only one thread to get access to file, should i use mutex
before starting actual reading of file.
Is it correct way. Please tell me when should i use mutex.
Please help me.

Thanks in advance.
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.