I am running some multi-threaded code that does the following.
On an STA thread, I create a
'worker' thread, and run it.
The STA thread then waits for the worker
thread to exit.
The worker thread calls a method on a proxy to an STA COM
object on the STA thread, and then exits.
In step 2, I'm using Thread.Join() to wait for the worke...
I am trying to figure out which I should be using. On closing my WinForm App fires of a Form in Dialog mode. That form runs a Background worker that Syncs the DB with the remote DB and displays it's progress on the "Splash Form."
I have a method like so -->
private void CloseMyApp()
{
SaveUserSettings();
...
I'm familiar with the control's dispatcher object but that doesn't solve my issue in an MVVM scenario.
I've got a UI command, that calls a method on my VM, that spawns a thread and then returns, when the thread is done (background worker might be good for this?) it will raise a callback, but the trick is, that callback modifies an obser...
I am looking to learn more about threading and I wanted to know: what is a multithreaded application?
...
Brief version of my question:
This code crashes the compiler.
pThread[0] = new boost::thread(
boost::bind(
&cGridAnimator::DoJob, // member function
this ), // instance of class
0 ); // job number
The compiler crashes when attempting to compile this code. ( It is not my program that...
We're running a web service as a web site project. Clients make requests which return after a few seconds, but which spawn a thread that should run for hours. The thread makes web requests and writes to a database, and is throttled with Thread.Sleep calls.
After running for about 20 minutes with several threads running, all the thread...
In the code below I create 20 threads, have them each print out a message, sleep, and print another message. I start the threads in my main thread and then join all of the threads as well. I would expect the "all done" message to only be printed after all of the threads have finished. Yet "all done" gets printed before all the threads...
Hi,
I have a slideshow application where i want to wait a certain amount of seconds, then show my front page, then wait again, then show next page, and so on. My problem is that when i use Thread.Sleep in between, the UI arent updated, it just sits there waiting and i only see my last control (after the full amount of time has passed (i....
How to Return a value from a thread?
in .NET
...
How is access to the UI thread handled in C#?
why is the UI thread treated differently from other threads?
thank you guys for your help
really appreciate it !
...
I have a core data application based on the default xcode template, I have the main UI which is used for viewing the data and then I have a background thread which is downloading/inserting/editing data.
I figured when the application launches I can create two NSManagedObjectContext, one which the applications reads from and the other in...
Hi all,
I'm trying to use the Win32 API to make a sub-thread that reads from STD_INPUT_HANDLE and pushes the bytes it reads into a socket. Because I want to be able to shut down this thread safely when it's time to exit, I'm using ReadFileEx() and overlapped I/O instead of plain old blocking ReadFile(). The idea is that my thread will...
I am reading http://www.mono-project.com/ThreadsBeginnersGuide.
The first example looks like this:
public class FirstUnsyncThreads {
private int i = 0;
public static void Main (string[] args) {
FirstUnsyncThreads myThreads = new FirstUnsyncThreads ();
}
public FirstUnsyncThreads () {
// Creating our two threads. The ThreadSta...
I am trying to learn Scala and find it a great language so far. I learn from "Beginning Scala" by David Pollak. In chapter 3 there is this piece of code, which illustrates how to write multi-threaded code without synchronized blocks (this code is copied from the book, it's available for download from Apress site, I don't mean to break an...
I've written a program in Qt Creator 1.0.0 (Qt version 4.5.0) where at the beginning of main() function I've put
srand(time(0));
Then I'm calling rand() from another thread (subclass of QThread). In that function, rand() is producing same sequence of numbers each time I'm running the program. Why is this happening?
Thanks in advanced...
I want to implement threading in c++.I am using visual stdio2008 and wish to implement threading using pthreads.can any one guide me about pthreads and also about there implementations in vs2008.Thanking in anticipation
...
Good afternoon everybody!
I have this threaded SerialPort wrapper that reads in a line from the serial port. Here is my thread's code.
protected void ReadData()
{
SerialPort serialPort = null;
try
{
serialPort = SetupSerialPort(_serialPortSettings);
serialPort.Open();
string data;
whi...
I'm trying to use ThreadLocal to provide thread safety to pre-existing non-thread-safe classes, but experiencing problems. It appears that there is no isolation being performed - that the threads still share the static, instead of it being local to each thread.
I believe my usage is almost exactly parallel with the example localization...
Hi everyone,
I have a static collections which implements IList interface. This collection is used throughout the application, including adding/removing items.
Due to multithread issue, I wonder what I can do to ensure that the list is modifying one at a time, such as when 1 thread try to add an item, another thread should not do delet...
Our website has a configuration page such as "config.aspx", when the page initializing will load some infomations from a configuration file. To cache the loaded informations we provided a factory class and we call a public method of the factory to get the configuration instance when the page loaded. But sometimes when the Applciation Poo...