Unit-testing multithreaded applications
Has anyone got any advice or know of any frameworks for unit-testing of multithreaded applications? ...
Has anyone got any advice or know of any frameworks for unit-testing of multithreaded applications? ...
We're using a hashtable to store sessions in a web service. I want to test thread safety of adding to this session. I wrote a Console App which generates lots of threads and adds to this session. But I am neither getting an exception nor losing any data. Am I doing anything wrong or isn't this much of operation a threat to hashtable?! ...
When doing context switching on a single-core processor, the code responsible is executed on the only CPU which takes care of switching the threads. But how is this done when we have multiple CPUs? Is there a master CPU which does all the context switching of all slave CPUs? Is each CPU responsible for its own context switching? If so, ...
I'm using tcp sockets to provide interprocess communication between two apps on Windows XP. I chose tcp sockets for various reasons. I'm seeing an average round-trip time of 2.8 ms. That's much slower than I was expecting. Profiling seems to show that the delay is between one app calling send and the other end's blocking recv returning. ...
I recently read the Head First Design Patterns book and I especially liked how the chapter on MVC seemed to bring everything together from the previous chapters. However, I am now on the verge of implementing a MVC pattern (using wxWidgets in C++) and I am beginning to realize that I don't understand threading issues as much as I should...
I'm new to wxWidgets (C++), and threads for that matter. What should I be aware of concerning shared resources? Should I implement some sort of semaphore-based locking of resources that may be used by both the GUI thread and the worker thread(s)? Does wxWidgets offer some capability for dealing with this? ...
I'm currently in the process of writing a client server app as an exercise and I've gotten pretty much everything to work so far, but there is a mental hurdle that I haven't been able to successfully google myself over. In the server application am I correct in my thinking that threading the packet handler and database handler to work ...
I want to make a Google App Engine app that does the following: Client makes an asynchronous http request Server starts processing that request Client makes ajax http requests to get progress The problem is that the server processing (step #2) may take more than 30 seconds. I know that you can't have threads on Google Application E...
I have a C#.NET application that needs to inform anywhere from 4000 to 40,000 connected devices to perform a task all at once (or as close to simultaneous as possible). The application works well; however, I am not satisfied with the performance. In a perfect world, as soon as I send the command I would like to see all of the devices r...
What package should I use and what would a "hello world"-level program look like? ...
I am writing a game server that has a time limit. I will be accepting input accross a socket until the timer is done. I am using a forever loop to receive data from the client. while(true) { socket.Receive(buffer); } I need to break out of this loop when the time limit ends. Sorry I don't think I am being specific enough. I h...
#include < thread > results in: error: thread: no such file or directory How can I install/use this library? ...
Lets say I have a large number of threads inserting into a mysql database using Java.sql. After i perform an insert i would like to know the primary key of the record i just inserted. I could use getRow() on the ResultSet returned by the insert query. However, is this thread safe? Or should I fire off another select statement to f...
I have an application that hangs whenever I call NSPrintOperation. I have a view that is creates a separate class (UIView) like this: PBPrintImage *printImage = [[PBPrintImage alloc] init]; printImage.image = finalImage; [printImage printWithNoPanel:self]; Then inside PBPrintImage I have the following method: - (void)printWithNoPane...
I installed boost on cygwin, and tried to compile the following program: #include <iostream> #include <boost/thread/thread.hpp> using namespace std; void hello() { cout << "Hello cworld" << endl; } int main() { boost::thread t(hello); t.join(); } via $ g++ test.cpp -lboost_thread /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../...
I want to implement a generic, thread save class which takes the RessourceId of an ImageView and the Url (http) where the desired image file is stored. It'll download the image and fills the src of the ImageView in the UiThread. I thought AsyncTask would be the best thing for me. However I noticed that I only can pass one type of parame...
Hi there, I have a Brush Colour which I would like to change every so and so on a thread. static SolidColorBrush myBrush; Thread changeColourThread = new Thread(changeColour); static void changeColour() { myBrush = new SolidColorBrush(Color.FromArgb(255, 33, 96, 22)); } This returns an UnauthorizedAccessException, what's the...
Hi, We are porting modeling application, which uses IronPython scripts for custom actions in modeling process. The existing application executes each Python script in separate thread and uses cooperative model for this. Now we want to port it to TPL, but first we want to measure context switching . Basically, what we have right now: ...
I have an application (server application) that needs an extensive amount of logging implemented and shouldn't be too affected performance wise by enabling logging. The application has a thread pool of worker threads performing the work. Originally I was going to just log on these thread pool threads, but then I'd need to lock practica...
This function runs on the UiThread, but it seems that doesnt mean it also has access to the activity context. Shall I implement to my AsyncTask a public Setter to pass the activity (as reference)? protected void onPostExecute( Bitmap bitmap ) { //following is underlined red due to missing context (ImageView)findViewById...