I have a native Visual C++ COM object and I need to make it completely thread-safe to be able to legally mark it as "free-threaded" in th system registry. Specifically I need to make sure that no more than one thread ever accesses any member variable of the object simultaneously.
The catch is I'm almost sure that no sane consumer of my ...
I am on MacOSX.
I am writing a multi threaded program.
One thread does logging.
The non-logging threads may crash at any time.
What conventions should I adopt in the logger / what guarantees can I have?
I would prefer a solution where even if I crash during part of a write, previous writes still go to disk, and when reading back the lo...
Hi all.
I created and started some Threads that each one writes something to a common text file.
but the following error appears to me:
"The process cannot access the file 'C:\hello.txt' because it is being used by another process."
void AccessFile()
{
int num = 5;
Thread[] trds = new Thread[5];
for (int ...
I want to run a thread pool on server side & want to show threads work progress on client side. Is this possible. If so kindly guide me. thanx in advance
...
Hi,
I have a timer that ticks every 3 seconds.
If the timer found something a messagebox will show.
Then the timer should wait 30 seconds, before he show again the messagebox (the user of course must have time to react).
How can I handle this?
I tried a Thread.Sleep(30000), but the GUI blocks of course.
My other Idea is a second time...
How to lock the directory that is beign processed in a thread ? and The Wait to write a new set of file to the directory after the folder is released by the thread that started procesing the folder?
...
Hi,
I am writing a multithreaded socket application in Python using the socket module.
the server listens for connections and when it gets one it spawns a thread for that socket.
the server thread sends some data to the client. but the client is not yet ready to receive it. I thought this would have caused the server to wait until the ...
What is the best way to finish a multi-threaded application in a clean way?
I am starting several socket connections from the main thread in seperate sockets and wait until the end of my business day in the main thread and use currently System.Environment.Exit(0) to terminate it.
This leads to an unhandled execption in one of the childs....
Hi, I believe I have a potential threading issue. I have a user control that contains the following code:
private void btnVerify_Click(object sender, EventArgs e)
{
if (!backgroundWorkerVerify.IsBusy)
{
backgroundWorkerVerify.RunWorkerAsync();
}
}
private void backgroundWorkerVerify_DoW...
Is there a way by which we can simulate thread level constants in C++? For example, if i have to make a call to template functions, then i need to mention the constants as template level parameters? I can use static const variables for template metaprogramming, but they are process level constants.
I know, i am asking a question with a...
Hi.
I want to be able to in some way "quee" operations on Apache web server with PHP. For example I want to create a loop like this:
<?php
foreach($files as $key=>$value){
download($value);
}
?>
The "download" function just runs wget and downloads the file to a specified position. This is working OK but my problem is that during this...
In my program, I am creating several threads in the main() method. The last line in the main method is a call to System.out.println(), which I don't want to call until all the threads have died. I have tried calling Thread.join() on each thread however that blocks each thread so that they execute sequentially instead of in parallel.
Is ...
I have a fairly well multi-threaded winforms app that employs the EventWaitHandle in a number of places to synchronize access.
So I have code similar to this:
List<int> _revTypes;
EventWaitHandle _ewh = new EventWaitHandle(false, EventResetMode.ManualReset);
void StartBackgroundTask() {
_ewh.Reset();
Thread t = new Thread(new ...
In an asp.net web application, say everytime the user makes the request, and the page loads, a thread is fired off that uses thread.join() to block execution until it's finished.
Say this thread takes 10 seconds to complete.
Does this mean that if 5 totally seperate users make a request to this page, mere miliseconds after the last, do...
I have a web application that synchronizes with a central database four times per hour. The process usually takes 2 minutes. I would like to run this process as a thread at X:55, X:10, X:25, and X:40 so that the users knows that at X:00, X:15, X:30, and X:45 they have a clean copy of the database. It is just about managing expectation...
I am reading a book that compares two ways of implementing threads, Middleware Threads and OS Threads. I don't know what the meaning of these sentences are exactly:
"A difficulty of operating system multithreading, however, is performance overhead. Since it is the operating system that is involved in switching threads, this involves syst...
I have a piece of mature geospatial software that has recently had areas rewritten to take better advantage of the multiple processors available in modern PCs. Specifically, display, GUI, spatial searching, and main processing have all been hived off to seperate threads. The software has a pretty sizeable GUI automation suite for funct...
I have a number of threads that are performing a long runing task. These threads themselves have child threads that do further subdivisions of work. What is the best way for me to track the following:
How many total threads my process has created
What the state of each thread currently is
What part of my process each thread has current...
In my application, I have a 'logging' window, which shows all the logging, warnings, errors of the application.
Last year my application was still single-threaded so this worked [quite] good.
Now I am introducing multithreading. I quickly noticed that it's not a good idea to update the logging window from different threads. Reading so...
I'm creating an application which communicates with the device via FT2232H USB/RS232 converter. For communication I'm using FTD2XX_NET.dll library from FTDI website.
I'm using two threads:
first thread continuously reads data from the device
the second thread is the main thread of the Windows Form Application
I've got a problem when ...