multithreading

Is there anyway to figure out the java timeslice on windows?

I know that the jvm timeslices threads, at least on windows. Is there anyway I can find out what the default timeslice is, or change the timeslice? One way I thought about is to write my own round robin scheduler and run it as a thread at a high priority level, and have it control all other threads. Would that work? ...

How to set core dump naming scheme without su/sudo?

Hello, I am developing a MPI program on a Linux machine where I do not have sudo/su access. As my program currently segfaults, I would like to examine the core dumps via gdb. Unfortunately, as the program is multi-threaded, all the threads write to one core dump. So I would like to be able to append the PID to each separate core dump fo...

System.Reflection.MethodInfo.Invoke and multiple threads

Hi how do i call System.Reflection.MethodInfo.Invoke() with paramters with threads. For instance.. Say I have a method that allows you to pass in a string that represents a class name and calls corresponding class method dynamically , now i want to call this Methodinfo.invoke with threads ,I have no idea how to do this since i am call...

Synchronization in J2ME

If one doesn't use Threads or Timers, they wouldn't need synch, as all input/output is handled by a single thread. However, if one introduces TimerTasks, synchronization would be mandatory. There are two ways to synch the code in J2ME: The usual: using locks Using Display.callSerially(Runnable r) so that all external events would be s...

Show Loading modal from ActiveX control

I am connecting to a webservice from an active x control which can sometimes take time to respond. When it takes time IE gets locked (NOT RESPONDING) how can I showing a "Loading" kinda of modal while it is waiting for the webservice Any examples or links to examples will be helpful thanks. ...

Delphi 2010: Advantage of running multi threads if cannot allocate memory to create object for calculation in each thread

Hi everyone, My Previous Question From the above answer, means if in my threads has create objects, i will face memory allocation/deallocation bottleneck, thus result running threads may slower or no obvious time taken diff. than no thread. What's the advantages of running multi threads in the application if I cannot allocate memory to...

Some questions about pthread_mutex_lock and pthread_mutex_unlock

When a thread has acquired the lock and execute the following code, Could the thread will unlock the lock it has acquired just with the return statement? some code like this. static pthread_mutex_t mutex; int foo() { pthread_mutex_lock(mutex); ......... execute some code here and some errors happen ...

Define culture for entire appdomain

I'm creating a windows service that runs multiple threads. Can I set the culture of my entire appDomain, instead of setting it to each thread separately? ...

How to terminate a worker thread correctly in c#

Problem statement I have a worker thread that basically scans a folder, going into the files within it, and then sleeps for a while. The scanning operation might take 2-3 seconds but not much more. I'm looking for a way to stop this thread elegantly. Clarification: I want to stop the thread while it's sleeping, and not while it's scan...

C# Thread object lifetime

Suppose I have a code as follows: int Main() { if (true) { new Thread(()=> { doSomeLengthyOperation(); }).Start(); } while (true) { //do nothing } } There are 2 threads, I'm going to call the Main thread the thread that is executing the Main() function, and the th...

gui hangs even with thread

Hi, I have a problem with a java gui and opening a document. My problem is the complete gui hangs until the document is open, but I already threaded the action... I have this action listener: this.EditButton.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent arg0) { ...

Creating a WPF element in another Thread

Hi I'm able to run 2 or more WPF windows on different thread. The problem is that now my application in splitted in many windows. What I really want is have a main window containg a grid in which every cell contains an element managed by a different thread. Is it possible to create a UIElement/Component managed by a thread that is not...

C: pthread performance woes. How can I make this code perform as expected?

I have created this little program to calculate pi using probability and ratios. In order to make it run faster I decided to give multithreading with pthreads a shot. Unfortunately, even after doing much searching around I was unable to solve the problem I have in that when I run the threadFunc function, with one thread, whether that be ...

Keep threads and views alive between Activities

Trying to understand the Android framework model. I have an application that needs to have several threads running. On thread gets GPS fixes, another picks up GPS fixes and pushes them to server, and yet another occasionally polls a server for dispatched orders. Some of these threads update status Views as well. Since I am new to And...

What is the BlockingCollection.TakeFromAny method useful for

I need to build a blocking priorty queue and my hunch is that TakeFromAny may be the secret ingredient, however the documentation on that method is sparse. What is its purpose / appropriate use/ My requirement is that multiple threads will add to either a high priority or low priority queue. One thread will consume these two queues alw...

Converting single-threaded legacy code with global variables to multithreaded code using thread-local storage

I have a code-base of legacy C/C++ code, which contains lots of functions that access global static variables, and are therefore not thread-safe. I'm looking for advice on how to convert this code to make it thread safe. It occurs to me that one way to do it would be to convert the static variables into thread-local variables, or otherwi...

Perl: Threading with shared multi-dimensional hash

I am trying to share a multi-dimensional hash over multiple threads. This hash holds 2 connected key-pairs, I need to know if they are already connected, if they are not, I need to connect them, if not, there is no need to go to the database. use threads; use threads::shared; my %FLUobject2param : shared = (); #Start a new thread f...

Getting Snapshot Slows UI - Thread Needed?

I'm currently working on a WPF/C# application which is connected to an external camera. This application gets a snapshot from the camera, then does some analysis and displays it to the screen via a user interface. There are also many other UI elements on the interface (such as buttons, menus, and comboboxes). Right now, while the appl...

Setting up SVNKit when multithreading

I'm trying to connect to many SVN repositories in parallel, using different threads, with SVNKit. Looking at some code examples online, it looks like before using SVNKit I have to initialize it using the static methods DAVRepositoryFactory.setup(); SVNRepositoryFactoryImpl.setup(); FSRepositoryFactory.setup(); Obviously static method...

Infinite Thread that may or may not run a CDialog each loop

I am working on a MFC project where I need a separate loop that will run continually or once every few seconds, and each time it may or may not need to run a Dialog to get some input from the user. I was thinking of using AfxBeginThread, but from what I have read about it, it doesn't really work with a continuous loop. ...