|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Treading for console applications in VB.NETto write a console application using synchronized threads, as I don't need any display or operator interface. However, when I call Monitor.Wait on any thread created, an exception is thrown with the following description: "Object synchronization method was called from an unsynchronized block of code." I've searched for any statement on this, but there is nothing definitive that says threading in a console application is not allowed. Some of the code samples imply a console app. Is threading (or at least synchronizing threads) simply not possible in a console application? Frank Maxey *** Sent via Developersdex http://www.developersdex.com *** Frank,
Monitor.Wait can only be called with the thread currently owns the lock. That means a previous call to Monitor.Enter (or by using the SyncLock keyword) has occurred. Brian fdmaxey wrote: Show quoteHide quote > I have used threading in Windows applications successfully. I am trying > to write a console application using synchronized threads, as I don't > need any display or operator interface. > > However, when I call Monitor.Wait on any thread created, an exception is > thrown with the following description: > > "Object synchronization method was called from an unsynchronized block > of code." > > I've searched for any statement on this, but there is nothing definitive > that says threading in a console application is not allowed. Some of > the code samples imply a console app. > > Is threading (or at least synchronizing threads) simply not possible in > a console application? > > > Frank Maxey > > *** Sent via Developersdex http://www.developersdex.com ***
Auto-Updates using MSI
Set PrivateFont in browser richtextbox changing fontstyles for selected text is it possible to get delegates from properties directly? "Global" objects Parsing the appended data of log file in real time Control.BackColor Transparency, Control.BackColor = Color.Transparent Copying A Control Not As A Reference XML-RPC Change the rowspan, columnspan property of a button control in a TableLayoutPanel at runtime |
|||||||||||||||||||||||