multithreading

Do spawned threads automatically run as the identity of the user?

ie static void Main(string[] args) { var thread = new Thread(WhoAmI); thread.Start(); } static void WhoAmI() { //can i access network resources as the user who ran Main? } ...

unable to successfully call function in dynamically loaded plugin in c++

I've successfully loaded a C++ plugin using a custom plugin loader class. Each plugin has an extern "C" create_instance function that returns a new instance using "new". A plugin is an abstract class with a few non-virtual functions and several protected variables(std::vector refList being one of them). The plugin_loader class success...

Displaying the activityView Indicator well data is downloading

Im currently writing an iphone app that requires the downloading of data that needs to be parsed and added to a tableView. I have that working the only problem is that i currently call the my method that downloads that data and parses it in the viewDidLoad {} method: - (void) addData { //Download some stuff //Parse some stuff /...

what is the best way to synchronize container access between multiple threads in real-time application

Hi, I have std::list<Info> infoList in my application that is shared between two threads. These 2 threads are accessing this list as follows: Thread 1: uses push_back(), pop_front() or clear() on the list (Depending on the situation) Thread 2: uses an iterator to iterate through the items in the list and do some actions. Thread 2 is i...

Java: Thread.currentThread().sleep(x) vs. Thread.sleep(x)

I have this in my code Thread.currentThread().sleep(x); Eclipse tells me to use the static Thread.sleep(x); instead, why? What's the difference, is there some difference in functionality at all between these 2 methods? ...

Only one thread at a time!

Hey there! Here's my code: new Thread() { @Override public void run() { try { player.play(); } catch ( Exception e ) { System.out.println(e); } } }.start(); which creates and starts a thread. I'd like to modify this code so that the thread only starts if there are no other threads open at the time! If ther...

'working, please wait' screen with thread?

Dear Programmers, Perhaps, it is very easy for you, but I am hard working on a project (for educational purposes) that is querying adsi with TADSISearch component, for several days. I'm trying to show a 'Working, Please wait..' splash screen with a man worker animated gif on Form2 while TADSISearch is searching the Active Directory. Alt...

Possible Threading, Variable copy issue

We have an application that runs a routine like: protected string _largeFile; Execute() //this executes in basically an infinite loop. { _largeFile = ""; DoStuff(); DoStuff(); _largeFile = "ReallyBigString"; //sometimes 4-5Mb if(_largeFile != "") { RaiseEvent(); } DoStuff(); DoSTuff();...

Why does JVM does not terminate when using RMI

Hi! I just read the Trail on RMI from sun at http://java.sun.com/docs/books/tutorial/rmi/implementing.html When I run the example, the JVM does not terminate although main has finished. Is RMI spawning a Thread somewhere internally? What is the behaviour of multiple Threads spawned in main, after main exits? Is it a clean way to let ...

Copying files which the main thread adds to a stringlist using a thread

I have a web creation program which, when building a site, creates hundreds of files. When the internet root folder is situated on the local pc, the program runs fine. If the internet root folder is situated on a network drive, the copying of a created page takes longer than creating the page itself (the creation of the page is fairly ...

Best way to slow down a thread? Is using Sleep() OK?

I've written a C++ library that does some seriously heavy CPU work (all of it math and calculations) and if left to its own devices, will easily consume 100% of all available CPU resources (it's also multithreaded to the number of available logical cores on the machine). As such, I have a callback inside the main calculation loop that s...

Is there an equivalent for Java WeakHashMap class in C#?

Is there a C# class that provides map with weak keys or/and weak values? Or at least WeakHashMap like functionality. ...

How to deal with multiple threads in one class?

Threads are often designed in two ways (see java tutorials): either by extending the Thread class or by implementing the Runnable class. Either way, you need to specify what will run inside the thread. I designed a class, an adapter towards an online resource, that retrieves different kinds of information. This class consists of method...

How to Debug a deadlock in Java using Eclipse

Hello What techniques can one use to debug what appears to be a deadlock in a Java program. My IDE is Eclipse and I think I've identifid the two deadlocked threads. In the debugger, right-clicking any of the threads in question and selecting suspend suspends the thread and displays the code currently being executed. Attempting step-into ...

What causes scheduled threads not to run in Java?

I have developed a small Java application that runs two scheduled threads via a scheduled executor service. On most computers my application runs just fine. In testing however I have come across a computer where my threads are not running as often as they should or not at all. I have one thread scheduled to run on 250 ms intervals. ...

Reading input from raw_input() without having the prompt overwritten by other threads in Python

I'm trying to let the user input commands at a console using raw_input(), this works fine. The problem is I have background threads that occasionally output log-information to the screen and when they do they mess up the input prompt (since the output go wherever the cursor happens to be at the moment). This is a small Python program th...

How can I notify the main thread of some message on another thread without blocking and waiting?

I'm writing a c# component that will only be used internally at my company. The component encapsulates communication with a number of servers that particular desktop applications need to communicate with. The servers can send unsolicited messages to the component, which are 'caught' in a separate thread. I want the majority of this comp...

multithreading in vb.net

what is multithreading and how do i do it in vb.net? ...

Walk the VisualTree in a worker thread for fulltext search

I am using WPF to show complex data (think reporting). I now need to have a fulltext search for it. We currently do this by walking the visual tree looking for textblocks. It seems that this needs to be done on the UI thread, is that right? The problem here is that it might take quite a while until the next match is found during wich the...

kill thread in pthread

I use pthread_create(&thread1, &attrs, //... , //...); and need if some condition occured need to kill this thread how to kill this ? ...