I'm writing a windows service and attempting to do some logging via enterprise library 4.0. Logs go to the event log and email. The event log entries get written fine but emails are only sent after I stop the service.
So I could have 30 exceptions occur, log them and no emails would be sent until I shut it down. Then a few minutes later...
The naming of this function seems like this is some complicated stuff going on. When exactly does one know that this is the way to go instead of doing something like this:
Preparation
CRITICAL_SECTION cs;
int *p = malloc(sizeof(int)); // Allocation Site
InitializeCriticalSection(&cs); // HINT for first Write
Thread #1
...
I have a stopwatch running in a different thread, that updates the GUI thread in a label to show as time goes by. When my program closes, it throws a ObjectDisposedException when I call this.Invoke(mydelegate); in the Form GUI to update the label with the time from the stopwatch.
How do I get rid of this ObjectDisposedException?
I...
While reading up on SQLite, I stumbled upon this quote in the FAQ: "Threads are evil. Avoid them."
I have a lot of respect for SQLite, so I couldn't just disregard this. I got thinking what else I could, according to the "avoid them" policy, use instead in order to parallelize my tasks. As an example, the application I'm currently worki...
Consider the following shell script:
gzip -dc in.gz | sed -e 's/@/_at_/g' | gzip -c > out.gz
This has three processes working in parallel to decompress a stream, modify it, and re-compress it. Running time I can see my user time is about twice that of my real time, which indicates the program is effectively working in parallel.
I'...
I have a multi-thread C# application that uses some recursive functions in a dll. The problem that I have is how to cleanly stop the recursive functions.
The recursive functions are used to traverse our SCADA system's hierarchical 'SCADA Object' data. Traversing the data takes a long time (10s of minutes) depending on the size of our ...
I'm working on a simple job threading framework which is very similar to the one described in id Tech 5 Challenges. On the most basic level, I have a set of lists of jobs, and I want to schedule these list across a bunch of CPU threads (using a standard thread pool for the actual dispatching.) However, I wonder how this signal/wait stuff...
I am using MySQL c++ connector (1.0.5) , recently I moved get_driver_instance() and connect() methods to secondary thread then I am getting below error.
Error in my_thread_global_end(): 1 threads didn't exit
After googling I found that mysql thread isn't exiting. Is there a method in c++ wrapper to do cleanup?
...
I am writing a Python application in the field of scientific computing. Currently, when the user works with the GUI and starts a new physics simulation, the interpreter immediately imports several necessary modules for this simulation, such as Traits and Mayavi. These modules are heavy and take too long to import, and the user has to wai...
Hi,
My program has a main thread that takes command input from a user. Separately, it has potentially multiplie (at least 1) worker threads churning data in the background.
The user is able to terminate the program using a command by typing into the console. However, when the data churning is done, the main thread is still blocking wa...
I just want to do a simple, though thread-safe, boolean test (and set)
so:
if(myBoolean==false) //should not lock/wait!
{
myBoolean=true;
.....
}
else
{
....
}
I considered the following (although possibly incorrectly, so please correct me where I misunderstood)
using the Lock { if(myBoolean)... } construct seems ...
Hi,
I'm calling a "emit signal1()" from a non Qt thread.
By non Qt thread I mean not from the GUI Event Loop and not from any QThread run() method or any QThread own event loop.
It is simply a pthread (pthread_create()) that calls a method of a QObject which emits signals.
ex:
MyQbject: public QObject
{
...
void emitBunchOfSignals()
...
I’ve run into something strange about the effect of large memory allocations on the scalability of the .Net runtime. In my test application I create lots of strings in a tight loop for a fixed number of cycles and spit out a rate of loop iterations per second. The weirdness comes in when I run this loop in several threads – it appears th...
UPDATE: Just to summarize what my question has boiled down to:
I was hoping that constructing .NET forms and controls did NOT create any window handles -- hoping that process was delayed until Form.Show/Form.ShowDialog
Can anyone confirm or deny whether that is true?
I've got a large WinForms form with tab control, many many control...
Following my question yesterday, I tried to learn a bit more about the architecture of call stacks. Online and SO searches have not yielded the answer I'm looking for, which could be because I don't know precisely which keywords to use. Anyway, I'm sure someone here can help me...
First, lets start with an excerpt from Wikipedia's entry...
is it possible to force a thread to return from a call to a blocking function such as a blocking read from a stream ?
int x;
std::cin >> x;
for example...
...
I'm using python unittest in order to test some other external application but it takes too much time to run the test one by one.
I would like to know how can I speedup this process by using the power of multi-cores.
Can I tweak unittest to execute tests in parallel? How?
This question is not able python GIL limitation because in fact...
I have to multiply 2 (most of the times) sparse matrix.
Those matrix are pretty bit (about 10k*10k) and i've a two Xeon Quad core and just one thread for this job?
is there any fast library for multi-thread moltiplication? any other advice?
...
I have multiple downloads running in threads. I want to close the stream, say when user hits pause/stop download. How could I close the filestream of a download running in a thread?
...
I discovered 'ThreadStaticAttribute', and I have a lot of questions about it:
all my previous thread dependent static informations, were implemented as a static dictionary wich TKey is Thread, and when I wanted to access it, I used Thread.CurrentThread and that works. But this requires mantainance, because if a thread dies, I have to del...