I want to optimize my application number of threads.
Almost all of them have IO beside CPU usage in an equal value.
How much is the efficient number of threads when there are no other applications running in system.
I want the answer for Windows and under JVM.
...
Hi,
I am facing the problem, that I have an C# (.NET) object shared among some threads. A thread might replace the object with another one. The threads are waken up from a TCP/IP connection using the Asynchronous framework.
Sequence:
Threads (waiting for connection) -> Asynchronous Callback -> Do something thread-safe ->
Access the sh...
Reading this DZone article about Java concurrency I was wondering if the following code:
private volatile List list;
private final Lock lock = new ReentrantLock();
public void update(List newList) {
ImmutableList l = new ImmutableList().addAll(newList);
lock.lock();
list = l;
lock.unlock();
...
The following is the main body of code for an image resizer/compressor/uploader. This is my first silverlight project, and I am having trouble with the threading and gui updating as well as the webclient part, which does not function.The resizing and resampling seem to perform to my knowledge. The problem is the gui updating and uploadin...
I keep having this problem, solving it, and then when I implement new code it comes back again. It's driving me crazy!
What I finally found was that if you instantiate a Window of any kind, even if you never call Show() or ShowDialog(), when you close your application, it will not terminate. So now I make sure to call Close() when app...
This is the usage case:
Log(char* s); // prints out a log message
Now:
Log("hello world\n"); // called from Thread1
Desired output:
Thread1: hello world
Now:
Log("hello world\n"); // called from Thread2
Desired output:
Thread2: hello world
I can have a map that maps thread pids to strings. What I need however, is a functio...
What is API interception
When is it used
How to implement it in C++
...
Hi, can anyone please explain, whether accessing an array by multiple threads, where each thread is working on a different element of the array.
so there are n elements, and n threads ==>
the nth thread is working on the nth element of the array?
can any one be kind enough to explain if this is safe or not? and why or why not?
thank...
I am relatively new to .NET programming and multithreading in general, and was wondering if it is ok to use .NET provided BackgroundWorker to spawn off worker threads to do some work in a console application? From the various documentation online, I see that intent for this class is more for UI oriented applications, where you want to do...
I have an archive object which manages various byte arrays and hands out InputStreams and OutputStreams for reading and writing them. Each byte array has an associated ReentrantReadWriteLock.
The constructor of the subclass of InputStream which the archive produces acquires the lock for the relevant data, while close() releases the loc...
When I have two scripts with the same function names and arguments run in different threads with SUPPOSEDLY different environments, the second thread ends up overwriting the definitions of the first and the first thread's state gets garbage collected!
// My thread instancing function
lua_State* LuaInstance::RunInstance(const std::string...
I have an application that has many cases. Each case has many multipage tif files. I need to covert the tf files to pdf file. Since there are so many file, I thought I could thread the conversion process. I'm currently limiting the process to ten conversions at a time (i.e ten treads). When one conversion completes, another should s...
I coding a service application that have two threads.
First thread, show a form with label.
Second thread, query ADO.
First thread always freezing with Hourglass cursor and no label caption.
Please help.
...
A call to clear on a QByteArray generates the following exception:
* glibc detected * /home/yan/FPS2/FPS2: double free or corruption (fasttop):
0 ??
1 ??
2 free
3 QByteArray::clear()
4 FPSengine::getDatagrams
5 FPSengine::xmitData
6 FPSengine::getData
7 threadDatalog::run
8 ??
9 start_thread
10 clone
11 ?? 0
is this a qt ...
Hi,
Small question. Every object I know of in python can take care of its base class initialization by calling
super(BaseClass, self).__init__()
This doesn't seem to be the case with a subclass of threading.Thread, since if I try this in SubClass.__init__(), I get:
RuntimeError: thread.__init__() not called
What gives? I looked ...
I have a Win32 native VC++ application that upon entering WinMain() starts a separate thread, then does some useful job while that other thread is running, then simply exits WinMain() - the other thread is not explicitly stopped.
This blog post says that a .NET application will not terminate in this case since the other thread is still ...
When I debug my program with netbeans using cygwin's g++, when it receives a sigabrt, I can't see my code anywhere in the call stack of any of the threads. Most of them are at ntdll!RtlEnableEaryCriticalSectionEventCreation() and one in RaiseException(). The problem is that after these there are only either some win32 functions without a...
Im using xmpp4r and trying to get the hang of a basic chat feature that I wish to implement later in my Rails app. My fundamentals on Ruby Threads is still a bit shaky so I would appreciate any help on this.
Though I register the callback i dont get a response from my gmail account. I am able to send a message but my ruby program termi...
Which one synchronization method to use to ensure a singleton remains a singleton?
+(Foo*)sharedInstance
{
@synchronized(self)
{
if (nil == _sharedInstance)
{
_sharedInstance = [[Foo alloc] init];
...
}
}
return _sharedInstance;
}
or using a mutex?
#import <pthread.h>
static pthread_mu...
I have a service configured with following attributes
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
public class UserService : IUserServiceContract
{}
Should I use in this scenario locking mechanism for methods implemented in the service?
If yes, is this the proper im...