Django's get_or_create function always cause "get() returned more than one Model name" error in a multi-threaded program.
I even tried to put get_or_create statement inside a lock.acquire() and lock.release() block but still didn't work.
The program only works when I set thread_count=1
The database is on InnoDB engine. How to fix this...
Hi,
Can somebody help me on this:
private Thread workerThread;
private EventWaitHandle waitHandle;
if (workerThread == null)
{
workerThread = new Thread(new ThreadStart(Work));
workerThread.Start();
//workerThread.Join();
}
else if (worke...
I am working in multithreading application, application is facing some problem while processing the request.
When i kept load on multithreaded application,it is working fine up to some time.After some time it is not able to process any request.At this situation when type this command,
ps -eLF | grep multithread
all threads are showing...
I thought that calling BeginInvoke more than once on the same delegate instance would cause problems, but I tried it out and it works. Why is that?
Is the IAsyncResult object returned with each BeginInvoke called unique instead of each instance of the delegate?
In other words, do I only need one instance of the delegate to spawn multip...
I would like to describe some specifics of my program and get feedback on what the best multithreading model to use would be most applicable. I've spent a lot of time now reading on ThreadPool, Threads, Producer/Consumer, etc. and have yet to come to solid conclusions.
I have a list of files (all the same format) but with different con...
Can any one share some study material for multithreading on .net?
EDIT: I don't want to learn too much details
...
any idea suggestion about BGW for long-running operation?
...
Hi,
I am trying to plug some shameful gaps in my Java threading knowledge, and I'm reading Java Concurrency in Practice by Brian Goetz et al (highly recommended BTW), and one of the early examples in the book leaves me with a question. In the following code, I totally understand why synchronization is needed when updating the hits and ...
Hi guys....
I'm digging little bit the TestNG framework.
I'm using annotations to configure thread values in my test case, example:
@Test(threadPoolSize = 2, invocationCount = 10)
public void testOne() {
//some code
}
The idea is config these values in a config file and this values should be passed to all tests.
So I...
I would like to have an object be callable from the main thread
MyObj* backgroundObject = [[MyObj alloc] initInBackground];
BOOL result = [backgroundObject computeResult];
But have all the methods of backgroundObject compute in another thread.
And also have backgroundObj be able to send messages to it's delegate. How can I do such a ...
Hi,
recently I record several hours of .NET Memory counters of a WCF service. The service is hosted in IIS on a Win2k8, 8 core, x64 with 20GB ram.
I can see the GC being pretty healthy, performing a full collection only approx. every 2hrs!
I noticed that in the very same time period, the number of physical and logical threads increase...
I am using ACE threads and need each thread to have its own int member.
Is that possible?
...
Are static variables stored on the stack itself similar to globals? If so, how are they protected to allow for only local class access?
In a multi threaded context, is the fear that this memory can be directly accessed by other threads/ kernel? or why cant we use static/global in multi process/ thread enviornment?
...
i got a new programing book (multicore programming by cameron hughes, tracey hughes).
so far i have not got one of their programs to work their book says that it should work on 99% of computers so im a little confused but at the end of each program in their book they have "compile and link instructions"... do i need to enter that? it loo...
In ANSI C on Windows what is the best/easiest way to transfer data between two programs running locally without needing to write/read from a file? Data will be basic text and only one program will be sending and the other receiving. Thanks.
...
If i use thread like this:
void foo()
{
new Thread().Start();
}
since the Thread object is not referenced, will it be disposed by GC before the designated work is done?
...
Hello all :)
I'm looking at a simple class I have to manage critical sections and locks, and I'd like to cover this with test cases. Does this make sense, and how would one go about doing it? It's difficult because the only way to verify the class works is to setup very complicated threading scenarios, and even then there's not a good w...
Hi,
The following class is not thread-safe (as proven in http://stackoverflow.com/questions/2410499/proving-the-following-code-not-thread-safe )
Is there a framework out there that can help with either compile time / run time analysis and tell us that the following is not thread safe?
For compile time, ideally in Eclipse the wiggly un...
This question was posted on some site. I didnt find right answers there, so I am posting it here again.
public class TestThread {
public static void main(String[] s) {
// anonymous class extends Thread
Thread t = new Thread() {
public void run() {
// infinite loop
while (true) {
try {
...
Hi
I've read all recommended articles on SynchronizationContext, but there is one small question I did not find an answer for.
In my case I have an event handler that calls a Log() method that outputs text to a TextBox. Log() is called from a WCF service. The event is raised from WCF client instances (threads).
Usually, I check Control.I...