473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Threading priority (maybe?)

I have a form that contains the attached code that starts a new thread.
Thewre are three routines. StartMomnitoring starts the thread DoMonitor, and
StopMonitor stops the thread. The "SendRec" routine sends amessage out a
Tcp/Ip socket and returns the returned value. As the DoMonitor thread shows,
there is a sleep of 1 msec so I would expect a rate depending on the
internet latency. Here is the problem..

When started, I get an exchange rate of about 2 per second. However, if I
right click on the title barof the form, I get a pop up window with move,
close, etc options, and the rate increases to about 30 per second. I have
thought about trhread priority but changing the priority makes no difference.

Any thoughts anybody??
Public Sub StartMonitoring()
Dim t1 As New Thread(AddressOf DoMonitor)
Console.WriteLine("starting thread")
't1.Priority = ThreadPriority.Highest
t1.Start()
End Sub

Public Sub StopMonitoring()
Console.WriteLine("stopping thread")
RunStop = 0
End Sub

Sub DoMonitor()
Dim s As String
Dim ss As String
Dim p() As String
Dim pp As String
Dim I As Int32 = 0
Dim xx As Integer
RunStop = 1
Dim OFile As New StreamWriter(Application.StartupPath &
"\Data\LogFile.txt")
Do
If I = Count Then I = 0
s = Ant0.WriteRead(Cmd(I))
ss = Now.ToString("hh:mm:ss") & "," & s
Console.WriteLine(ss)
OFile.WriteLine(ss)
MonBox.Text = ss
'Thread.Sleep(10)
If RunStop = 0 Then Exit Do
I += 1
Loop
OFile.Close()
End Sub
Nov 21 '05 #1
0 879

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

Similar topics

19
by: Jane Austine | last post by:
As far as I know python's threading module models after Java's. However, I can't find something equivalent to Java's interrupt and isInterrupted methods, along with InterruptedException....
4
by: Joe Wong | last post by:
Hi, Is there any way to increase/decrease a thread priority in Python? Best regards, -- Wong
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
4
by: Bardo | last post by:
Hi, I have a situation where I am capturing both a WMI event utilising the "ManagementEventWatcher" in the "System.Management" namespace, and a corresponding event ("EntryWritten") raised from...
3
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested...
1
by: craigedmunds | last post by:
Was having a few problems with some threading issues following the microsoft support webcast Microsoft ASP.NET Threading. Spoke to Wade Mascia & managed to get clarification. Thought i'd share it...
0
by: hamil | last post by:
I have a form that contains the attached code that starts a new thread. Thewre are three routines. StartMomnitoring starts the thread DoMonitor, and StopMonitor stops the thread. The "SendRec"...
9
by: AdrianJMartin | last post by:
Hi all, I have a need for a STA thread from asp.net. I can create the thread and it runs fine. But when it is finished, the thread still 'hangs' arround. Visible only to the debugger..... I get...
8
by: Luc | last post by:
Hi, I am writing software to automate some testing. I have one main form to set up the tests, and once this is complete, I open 4 identical forms to monitor each different device that I am...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.