473,749 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why Does This Fail ( Threading )

Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--

Nov 21 '05 #1
17 1451

"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?
I would think it would have to be declared at a larger scope than the
procedure you need it in. I looks to me like you create and destroy a new
mutex for each call....

LFS
Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub


Nov 21 '05 #2
Hi,

First cant update the ui from a thread.
http://msdn.microsoft.com/msdnmag/is...asicInstincts/

Second. You might be better of with synclock instead a mutex

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)
synclock g

g.DrawImage(i, p)

end synclock
End Sub
Ken
-----------------
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--


Nov 21 '05 #3
Don't declare the mutex at the procedure level, perhaps try to at the
module/class level. Otherwise, each time you enter the procedure you create
a new (and unnamed) mutex variable which the other thread doesn't care
about. So of course it tries to write.

Alright, so after doing some more reading, was looking at the waithandle and
how that works. Look into AutoResetEvent, in which case its defined as the
threads communicating through events... I can help more in a minute, but
have to finish something else now and wanted to get this out to you. It
inherits from WaitHandle (same as Mutex waitone). but has a few more
options that do the dirty work under the sheets...

Check it out and let me know if it helps..
-CJ

I'll write more shortly.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--

Nov 21 '05 #4
Tried decaling the Mutex in a module,that didnt work either

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"Larry Serflaten" <se*******@usin ternet.com> wrote in message
news:eC******** ******@tk2msftn gp13.phx.gbl...

"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?


I would think it would have to be declared at a larger scope than the
procedure you need it in. I looks to me like you create and destroy a new
mutex for each call....

LFS
Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub


Nov 21 '05 #5
tried Synclock, that doesent seem to work

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi,

First cant update the ui from a thread.
http://msdn.microsoft.com/msdnmag/is...asicInstincts/

Second. You might be better of with synclock instead a mutex

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)
synclock g

g.DrawImage(i, p)

end synclock
End Sub
Ken
-----------------
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--

Nov 21 '05 #6
tried declaring at module level, that didnt work. Tried Synclock, that didnt
work either

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eK******** ******@TK2MSFTN GP09.phx.gbl...
Don't declare the mutex at the procedure level, perhaps try to at the
module/class level. Otherwise, each time you enter the procedure you
create
a new (and unnamed) mutex variable which the other thread doesn't care
about. So of course it tries to write.

Alright, so after doing some more reading, was looking at the waithandle
and
how that works. Look into AutoResetEvent, in which case its defined as
the
threads communicating through events... I can help more in a minute, but
have to finish something else now and wanted to get this out to you. It
inherits from WaitHandle (same as Mutex waitone). but has a few more
options that do the dirty work under the sheets...

Check it out and let me know if it helps..
-CJ

I'll write more shortly.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--


Nov 21 '05 #7
Try AutoResetEvent
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
news:eo******** ******@TK2MSFTN GP11.phx.gbl...
tried declaring at module level, that didnt work. Tried Synclock, that
didnt work either

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eK******** ******@TK2MSFTN GP09.phx.gbl...
Don't declare the mutex at the procedure level, perhaps try to at the
module/class level. Otherwise, each time you enter the procedure you
create
a new (and unnamed) mutex variable which the other thread doesn't care
about. So of course it tries to write.

Alright, so after doing some more reading, was looking at the waithandle
and
how that works. Look into AutoResetEvent, in which case its defined as
the
threads communicating through events... I can help more in a minute, but
have to finish something else now and wanted to get this out to you. It
inherits from WaitHandle (same as Mutex waitone). but has a few more
options that do the dirty work under the sheets...

Check it out and let me know if it helps..
-CJ

I'll write more shortly.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...
Assumes a Form with a Panel on it., Does the Mutex have to be within the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--



Nov 21 '05 #8
Same problem

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"CJ Taylor" <cege [ahh ttt] tavayn wooohooo hooo ohhh com> wrote in message
news:uL******** ******@tk2msftn gp13.phx.gbl...
Try AutoResetEvent
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
message news:eo******** ******@TK2MSFTN GP11.phx.gbl...
tried declaring at module level, that didnt work. Tried Synclock, that
didnt work either

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eK******** ******@TK2MSFTN GP09.phx.gbl...
Don't declare the mutex at the procedure level, perhaps try to at the
module/class level. Otherwise, each time you enter the procedure you
create
a new (and unnamed) mutex variable which the other thread doesn't care
about. So of course it tries to write.

Alright, so after doing some more reading, was looking at the waithandle
and
how that works. Look into AutoResetEvent, in which case its defined as
the
threads communicating through events... I can help more in a minute,
but
have to finish something else now and wanted to get this out to you. It
inherits from WaitHandle (same as Mutex waitone). but has a few more
options that do the dirty work under the sheets...

Check it out and let me know if it helps..
-CJ

I'll write more shortly.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...
Assumes a Form with a Panel on it., Does the Mutex have to be within
the
address of a thread start address ?

Cheers - OHM

'----------- *************** ----------------

Private endProgram As Boolean = False

Dim image1 As Image = Image.FromFile( "..\Images\gun. bmp")

Dim image2 As Image = Image.FromFile( "..\Images\Inva der.bmp")

Dim space As Graphics

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim Thread1 As New Threading.Threa d(AddressOf Me.WriteImage1)

Dim Thread2 As New Threading.Threa d(AddressOf Me.WriteImage2)

space = Panel1.CreateGr aphics()

Thread1.Start()

Thread2.Start()

End Sub

Private Sub WriteImage1()

While Not endProgram

DrawImage(space , image1, New Point(10, 10))

End While

End Sub

Private Sub WriteImage2()

While Not endProgram

DrawImage(space , image2, New Point(50, 50))

End While

End Sub

Public Sub DrawImage(ByVal g As Graphics, ByVal i As Image, ByVal p As
Point)

Dim m As New Threading.Mutex

m.WaitOne()

g.DrawImage(i, p)

m.ReleaseMutex( )

End Sub
--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--




Nov 21 '05 #9

"One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote
Tried decaling the Mutex in a module,that didnt work either


I suggested using a delegate. Try this out in a new form with one button.
Paste in the code after the designer code.

Also as I was building this up, it occured to me that some sort of pooling
should be used, should it not? Invaders come and go over the course of the
game, so pooling may let the system managed them a little better....

HTH
LFS

Private GrxForm As Graphics
Private th1, th2 As Threading.Threa d
Private brh As SolidBrush = New SolidBrush(Colo r.Black)
Private rnd As Random = New Random
Private fnt As Font = New Font("tahoma", 24, FontStyle.Bold)

Delegate Sub Drawing(ByVal ID As Integer, ByVal Loc As PointF)
Private Dlg As New Drawing(Address Of CommonDraw)

Private Done As Boolean

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
GrxForm = Me.CreateGraphi cs
Th1 = New Threading.Threa d(AddressOf Thread1)
Th2 = New Threading.Threa d(AddressOf Thread2)
Th1.Start()
Th2.Start()
End Sub

Private Sub CommonDraw(ByVa l ID As Integer, ByVal Loc As PointF)
Dim klr As Color = Color.FromArgb( 200, rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))
' The Brush, Font and Graphics are shared
brh.Color = klr
GrxForm.FillRec tangle(brh, Loc.X, Loc.Y, 80, 50)
GrxForm.DrawStr ing(CStr(ID), fnt, Brushes.Black, Loc)
End Sub

Sub Thread1()
Dim id As Integer = 1
Dim loc As PointF = New PointF(10, 10)
Do While Not Done
Me.Invoke(Dlg, New Object() {id, loc})
Threading.Threa d.Sleep(100)
Loop
End Sub

Sub Thread2()
Dim id As Integer = 2
Dim loc As PointF = New PointF(100, 10)
Do While Not Done
Me.Invoke(Dlg, New Object() {id, loc})
Threading.Threa d.Sleep(100)
Loop
End Sub

Private Sub Form1_Closing(B yVal sender As Object, ByVal e As System.Componen tModel.CancelEv entArgs) Handles MyBase.Closing
e.Cancel = Done
Done = True
Application.DoE vents()
Th1.Abort()
Th2.Abort()
End Sub

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2982
by: Egor Bolonev | last post by:
hi all my program terminates with error i dont know why it tells 'TypeError: run() takes exactly 1 argument (10 given)' =program==================== import os, os.path, threading, sys def get_all_files(path): """return all files of folder path, scan with subfolders
2
13191
by: Amadej | last post by:
Hello everyone I have a beginner's questions about the System.Threading.Timer class behavior. I have been observing the thread count with Windows Task Manger and noticed that timers, after being disposed, do not seem to end their thread after the timers stop working). For instance, when making a simple timer with the following code: public System.Threading.Timer timerTest; public System.Threading.TimerCallback tCallBack;
7
6164
by: Bill Cumming | last post by:
Is there something about C++ / C# interop that initializes the threading model to MTA so that OleInitialize will fail? I have a mostly C++ app that calls a single C# class DLL. Only one source file in the C++ app is compiled as managed (with /clr) – the single file in which only one of the many functions creates a class object from the C# DLL and invokes its methods (to decode an XML file the easy way). During normal execution my...
6
5451
by: Ilia | last post by:
Hi folks, I have some problems with ASP.NET Session State. The following simple program runs well if the Session State set as "InProc". If I switch to "SQLServer", the changes, made by the second thread, are lost. Any idea? I use VS.NET 2003 on Windows Server 2003 with hot fixes (as of 30-Oct-2003) and SQL Server 2000 SP 3a.
4
19460
by: garyusenet | last post by:
I am at a loss with this. I tried to go back to basics, and start learning all i didn't understand, starting at the top of the code file generated by VS. But I can't seem to get any sort of start on this problem, anything I read on the NET goes too far above my head to be of any use. For instance typical explanations say things like... 'The STAThreadAttribute marks a thread to use the Single-Threaded COM Apartment if COM is needed'
2
4438
by: Morgan Cheng | last post by:
By default, ThreadPool has 25 worker threads per CPU and 1000 IO threads for each process. I am wondering how CLR managed to allocate IO asynchronous tasks to IO thread and other asynchonous tasks to worker thread. With the help of Reflector, I found that default implementation of Stream.Read just use BeginInovke to get a IAsynResult. ReadDelegate delegate2 = new ReadDelegate(this.Read); ... ...
3
2301
by: jim | last post by:
VB.net code to turn monitor on and off....... <CODE> Module Module1 Const HWND_BROADCAST As Integer = &HFFFF Const SC_MONITORPOWER As Integer = &HF170 Const WM_SYSCOMMAND As Short = &H112S Sub Main() Dim instr As String = Command()
0
1344
by: screen.one | last post by:
Hi (Framework 1.1, Webservice platform Windows 2003 Server) I have a little windows service which is supposed to call one or more webservices at regular intervals. Recently this service has started to fail more and more often until now, when it won't run at all. I've managed to locate the problem, and it seems that when it makes an asyncronous webservice call, it doesn't get any notification when the
4
8845
by: Steven De Smet | last post by:
Hello, This is my first post. I searched on the internet for answers but I was unable to solve my problem. So I hope that you guy's can help me with my VB.NET problem I tried to create a windows service that converts MS Word Files into .PDF files and after that we want to zip the .PDF files. Our code: Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set...
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.