Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: ReadXML to dataset has problem with "&" inside the xml file Pin
Alex Korchemniy25-Jul-03 9:08
Alex Korchemniy25-Jul-03 9:08 
GeneralRe: ReadXML to dataset has problem with "&" inside the xml file Pin
Radoslav Bielik27-Jul-03 11:15
Radoslav Bielik27-Jul-03 11:15 
GeneralRe: ReadXML to dataset has problem with "&" inside the xml file Pin
Radoslav Bielik27-Jul-03 11:21
Radoslav Bielik27-Jul-03 11:21 
GeneralRe: ReadXML to dataset has problem with "&" inside the xml file Pin
johnxt27-Jul-03 17:38
johnxt27-Jul-03 17:38 
GeneralThread communication Pin
Alex Korchemniy25-Jul-03 8:48
Alex Korchemniy25-Jul-03 8:48 
GeneralRe: Thread communication Pin
albean25-Jul-03 9:31
albean25-Jul-03 9:31 
GeneralRe: Thread communication Pin
Alex Korchemniy25-Jul-03 9:44
Alex Korchemniy25-Jul-03 9:44 
GeneralRe: Thread communication Pin
Arun Bhalla25-Jul-03 10:47
Arun Bhalla25-Jul-03 10:47 
I had a similar problem. However, for me, I wanted to have a task get executed by a "main" background thread rather than in the GUI thread. It's the same problem as above, though.

Essentially, I employed a Command Queue design pattern, which the "main" thread monitors in some fashion.


Here's an interface:
interface ICommand 
{
  void Execute();
}


Then I can write some classes that implement the ICommand interface. For your case, the polling thread can construct some relevant object (that has the ICommand interface). This object can then be enqueued in a queue that the main thread monitors. Be sure to use some sort of synchronization on the thread -- it might be as simple as using the Queue.Synchronized() wrapper.

So, this queue could be a singleton object, which you might access via WorkQueue.Instance, or you could make it a private member of your MainThread class, and some public method of MainThread could be called from the polling thread, enqueuing the object. And you can use all sorts of techniques to look for any waiting commands in the queue...

Anyway, that's what I basically do, and it's pretty flexible for me, even though all I do is use it for executing a "Stop" command. It seems like one of the best ways to get another thread to execute some code.
GeneralRe: Thread communication Pin
albean25-Jul-03 10:59
albean25-Jul-03 10:59 
GeneralRe: Thread communication Pin
Arun Bhalla25-Jul-03 11:17
Arun Bhalla25-Jul-03 11:17 
GeneralRe: Thread communication Pin
albean25-Jul-03 11:32
albean25-Jul-03 11:32 
GeneralRe: Thread communication Pin
Alex Korchemniy25-Jul-03 15:10
Alex Korchemniy25-Jul-03 15:10 
GeneralRe: Thread communication Pin
Arun Bhalla28-Jul-03 8:55
Arun Bhalla28-Jul-03 8:55 
GeneralRe: Thread communication Pin
albean25-Jul-03 11:20
albean25-Jul-03 11:20 
GeneralOne Tuff Cookie Pin
RB@Emphasys25-Jul-03 7:54
RB@Emphasys25-Jul-03 7:54 
GeneralRe: One Tuff Cookie Pin
Jim Stewart25-Jul-03 8:44
Jim Stewart25-Jul-03 8:44 
GeneralRe: One Tuff Cookie Pin
RB@Emphasys25-Jul-03 8:50
RB@Emphasys25-Jul-03 8:50 
GeneralProblems registering a .NET class library in COM+ Pin
IsaacB25-Jul-03 7:38
IsaacB25-Jul-03 7:38 
Generalhelp Me pplease Pin
jphuphilly25-Jul-03 7:36
jphuphilly25-Jul-03 7:36 
GeneralRe: help Me pplease Pin
albean25-Jul-03 8:23
albean25-Jul-03 8:23 
GeneralRe: help Me pplease Pin
jphuphilly25-Jul-03 11:50
jphuphilly25-Jul-03 11:50 
GeneralRe: help Me pplease Pin
albean25-Jul-03 12:18
albean25-Jul-03 12:18 
GeneralRe: help Me pplease Pin
leppie25-Jul-03 12:59
leppie25-Jul-03 12:59 
GeneralRe: help Me pplease Pin
jphuphilly28-Jul-03 8:41
jphuphilly28-Jul-03 8:41 
GeneralRe: help Me pplease Pin
leppie28-Jul-03 10:24
leppie28-Jul-03 10:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.