I have a master control program that needs to run continuously, accepting
data and updating a datagrid for the user. As a result I have setup 2
threads, one accepts and processes incoming requests and updates the
database, whilst the other thread is started once a update has been
committed to the database. The problem is when the datagrid is accessed
after the first time it is unable to access the datagrid (Cannot clear this
list)?
I have delegated the threads and also checked and invoked the thread as
below: The listenthread functions without issue as it never stops running,
whilst the tableupdate thread terminates when no vieweable data alters. Any
help or guidance would be greatly appreciated.
Delegate Sub CreateDataSourceCallBack()
Private ThreadListen As New Thread(AddressOf ListenServerThread)
Private ThreadTableUpdate As New Thread(AddressOf CreateDataSource)
*** wrapped in a try ***
If Me.DGV1.InvokeRequired = True Then
Dim invoke_createdatasource As New CreateDataSourceCallBack(AddressOf
CreateDataSource)
Me.Invoke(invoke_createdatasource)
Else
Me.DGV1.Rows.Clear()
update grid here.......
I reset the thread to update the table as listed below:
If ThreadTableUpdate.ThreadState = ThreadState.Stopped Then
Me.ThreadTableUpdate = New Thread(New ThreadStart(AddressOf
Me.CreateDataSource))
Me.ThreadTableUpdate.Start()
End If 3 1111
Tlink,
It looks if you try to create a connected application using a Dataset. If
you are updatating the datasource of you cannot in the same time refill
that. It has to be one by one and needs too time time, that your user is
able to do as well things. You are pulling on four sides of the datagrid.
(Filling, updating from it by the database, Reading by the user, updating by
the user). This kind of operations are and stay forever serial and are not
parallel. (Although they can exist in any sequence as is needed).
Just my thought reading your message.
Cor
"Tlink" <Tl***@online.nospam> schreef in bericht
news:uZ**************@TK2MSFTNGP02.phx.gbl... I have a master control program that needs to run continuously, accepting data and updating a datagrid for the user. As a result I have setup 2 threads, one accepts and processes incoming requests and updates the database, whilst the other thread is started once a update has been committed to the database. The problem is when the datagrid is accessed after the first time it is unable to access the datagrid (Cannot clear this list)?
I have delegated the threads and also checked and invoked the thread as below: The listenthread functions without issue as it never stops running, whilst the tableupdate thread terminates when no vieweable data alters. Any help or guidance would be greatly appreciated.
Delegate Sub CreateDataSourceCallBack() Private ThreadListen As New Thread(AddressOf ListenServerThread) Private ThreadTableUpdate As New Thread(AddressOf CreateDataSource) *** wrapped in a try ***
If Me.DGV1.InvokeRequired = True Then Dim invoke_createdatasource As New CreateDataSourceCallBack(AddressOf CreateDataSource) Me.Invoke(invoke_createdatasource) Else Me.DGV1.Rows.Clear() update grid here.......
I reset the thread to update the table as listed below: If ThreadTableUpdate.ThreadState = ThreadState.Stopped Then Me.ThreadTableUpdate = New Thread(New ThreadStart(AddressOf Me.CreateDataSource)) Me.ThreadTableUpdate.Start() End If
I am unsure as to your response, what I am doing perhaps explained:
One thread that updates the database
One thread that reads the database and updates the datagrid
Does this help, as I am still confused?
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eU****************@TK2MSFTNGP02.phx.gbl... Tlink,
It looks if you try to create a connected application using a Dataset. If you are updatating the datasource of you cannot in the same time refill that. It has to be one by one and needs too time time, that your user is able to do as well things. You are pulling on four sides of the datagrid. (Filling, updating from it by the database, Reading by the user, updating by the user). This kind of operations are and stay forever serial and are not parallel. (Although they can exist in any sequence as is needed).
Just my thought reading your message.
Cor
"Tlink" <Tl***@online.nospam> schreef in bericht news:uZ**************@TK2MSFTNGP02.phx.gbl...I have a master control program that needs to run continuously, accepting data and updating a datagrid for the user. As a result I have setup 2 threads, one accepts and processes incoming requests and updates the database, whilst the other thread is started once a update has been committed to the database. The problem is when the datagrid is accessed after the first time it is unable to access the datagrid (Cannot clear this list)?
I have delegated the threads and also checked and invoked the thread as below: The listenthread functions without issue as it never stops running, whilst the tableupdate thread terminates when no vieweable data alters. Any help or guidance would be greatly appreciated.
Delegate Sub CreateDataSourceCallBack() Private ThreadListen As New Thread(AddressOf ListenServerThread) Private ThreadTableUpdate As New Thread(AddressOf CreateDataSource) *** wrapped in a try ***
If Me.DGV1.InvokeRequired = True Then Dim invoke_createdatasource As New CreateDataSourceCallBack(AddressOf CreateDataSource) Me.Invoke(invoke_createdatasource) Else Me.DGV1.Rows.Clear() update grid here.......
I reset the thread to update the table as listed below: If ThreadTableUpdate.ThreadState = ThreadState.Stopped Then Me.ThreadTableUpdate = New Thread(New ThreadStart(AddressOf Me.CreateDataSource)) Me.ThreadTableUpdate.Start() End If
Tlink,
What I want to say, is that the use of threads has in my opinion absolute no
sense.
The processes are complete serialized, so threads gives you only overhead
and trouble.
Cor
"Tlink" <Tl***@online.nospam> schreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl... I am unsure as to your response, what I am doing perhaps explained:
One thread that updates the database
One thread that reads the database and updates the datagrid
Does this help, as I am still confused?
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message news:eU****************@TK2MSFTNGP02.phx.gbl... Tlink,
It looks if you try to create a connected application using a Dataset. If you are updatating the datasource of you cannot in the same time refill that. It has to be one by one and needs too time time, that your user is able to do as well things. You are pulling on four sides of the datagrid. (Filling, updating from it by the database, Reading by the user, updating by the user). This kind of operations are and stay forever serial and are not parallel. (Although they can exist in any sequence as is needed).
Just my thought reading your message.
Cor
"Tlink" <Tl***@online.nospam> schreef in bericht news:uZ**************@TK2MSFTNGP02.phx.gbl...I have a master control program that needs to run continuously, accepting data and updating a datagrid for the user. As a result I have setup 2 threads, one accepts and processes incoming requests and updates the database, whilst the other thread is started once a update has been committed to the database. The problem is when the datagrid is accessed after the first time it is unable to access the datagrid (Cannot clear this list)?
I have delegated the threads and also checked and invoked the thread as below: The listenthread functions without issue as it never stops running, whilst the tableupdate thread terminates when no vieweable data alters. Any help or guidance would be greatly appreciated.
Delegate Sub CreateDataSourceCallBack() Private ThreadListen As New Thread(AddressOf ListenServerThread) Private ThreadTableUpdate As New Thread(AddressOf CreateDataSource) *** wrapped in a try ***
If Me.DGV1.InvokeRequired = True Then Dim invoke_createdatasource As New CreateDataSourceCallBack(AddressOf CreateDataSource) Me.Invoke(invoke_createdatasource) Else Me.DGV1.Rows.Clear() update grid here.......
I reset the thread to update the table as listed below: If ThreadTableUpdate.ThreadState = ThreadState.Stopped Then Me.ThreadTableUpdate = New Thread(New ThreadStart(AddressOf Me.CreateDataSource)) Me.ThreadTableUpdate.Start() End If
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tony Proctor |
last post by:
Hi everyone
We're experiencing some serious anomalies with the scheduling of ASP
threads. I'd be interested to hear if anyone knows what algorithm is used
(e.g. simple round-robin, or something...
|
by: Matthew Groch |
last post by:
Hi all,
I've got a server that handles a relatively high number of concurrent
transactions (on the magnitude of 1000's per second). Client
applications establish socket connections with the...
|
by: MuZZy |
last post by:
Hi,
Could someone pls help me here:
If i use async sockets in the separate thread like this:
void ThreadFunction()
{
.....
1. MySocket.BeginAccept(AsyncCallBack(OnConnectRequest),...
|
by: Sgt. Sausage |
last post by:
New to multi-threading (less than 24 hours at it <grin>)
Anyway, it's all making sense, and working fairly well
thus far, but I'm having a minor issue I'm not sure how
to get around.
I've got...
|
by: Urs Vogel |
last post by:
Hi
I wrote an application server (a remoting sinlgeton), where processes must
be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and
only after a Thread.Abort(), this...
|
by: taylorjonl |
last post by:
I am completely baffled. I am writting a daemon application for my
work to save me some time. The application works fine at my home but
won't work right here at work. Basically I have a...
|
by: puff |
last post by:
When interfacing to a COM object, is it possible to pump messages in a
thread?
I'm working on an application that automates IE and needs to monitor
IE events (yes I know about Pamie). I'm able...
|
by: Morpheus |
last post by:
Hi,
I have been coding in Windows for many years so have a mindset to it,
so forgive any stupid questions.
Is it possible to create a multithread application in C++ that is
portable...
|
by: =?Utf-8?B?VGhlU2lsdmVySGFtbWVy?= |
last post by:
Because C# has no native SSH class, I am using SharpSSH. Sometimes, for
reasons I do not know, a Connect call will totally lock up the thread and
never return. I am sure it has something to do...
|
by: Brad Walton |
last post by:
Hello. First post, but been doing a bit of reading here. I am working on a
project in Java, but decided to switch over to C# after seeing some of the
additional features I can get from C#. One of...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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,...
|
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...
|
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...
|
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,...
| |