I have a usercontrol that opens a form. i want this form to open as modal having its parent the same parent of the usercontrol. is that possible? (all i need is that the form is open modal).
when i tried (form.parent = this.parent) i got an error saying the form is a toplevel form.
then i tried (form.toplevel=false; form.parent=this.pa...
Hi there,
I have a function to download a mailmessage as MSG file from DocuShare server. The function works perfectly when called from a main thread. However, when I call the function in a separate thread, the download fails. When I step in to the code, I can see that the function is being called, all the parameters are evaluated correc...
I'm trying to understand how asynchronous file operations being emulated using threads. I've found next-to-nothing materials to read about the subject.
Is it possible that:
a process uses a thread to open a regular file (HDD).
the parent gets the file descriptor from the thread, now it may close the thread.
the parent uses the file de...
How do i add an entry in a listbox in a window that is in another thread.
My Problem is, that i have to threads.
One working thread, that does all the actual work and one thread for a window where i want to display status information.
I tried to pass the form window as paramater in the constructor, but when i call it i get an exception.
...
I've just finished reading "C# 4.0 in a Nutshell" (O'Reilly) and I think it's a great book for a programmer willing to switch to C#, but it left me wondering. My problem is the definition of using statement. According to the book (p. 138),
using (StreamReader reader = File.OpenText("file.txt")) {
...
}
is precisely equivalent to:
...
Hi, how to make the foreground thread wait for all background (child) threads to finish in C#? I need to get list of pending jobs from the queue (database), start a new thread to execute each of them and finally wait for all the child threads to finish. how to do that in C#? Thanks in advance.
...
Hi,
Can some kind soul please explain why the following psudocode would not work. The problem is that the lock can never be aquired on the backgroundWorker (Monitor.TryEnter(bw)) when called from a new thread. If I call it from the main UI thread it works fine.
Thanks
P
public class MyClass
{
private BackgroundWorker bw;
p...
Hello,
I wrote a python script that:
1. submits search queries
2. waits for the results
3. parses the returned results(XML)
I used the threading and Queue modules to perform this in parallel (5 workers).
It works great for the querying portion because i can submit multiple search jobs and deal with the results as they come in.
How...
This is my onCreate method of my first activity of my app. It initalizes all Widgets and then starts a Thread to load model data from the internet. In some cases, when the network is really slow or not responding, the "initializeModelThread" seems to take the whole CPU and doesnt allow the onCreate Methode to finish.
In one case I saw ...
Hi!
In my small Core Data application I have some NSTableView views binded with NSArrayController controllers in Entity mode.
When I try to import some big amount of data to my table in background thread, after some successfully added imports (from dozens to hundreds items) I get crash with log:
Serious application error. Exception w...
thank you for the asnwers
...
I have a low latency system that receives UDP messages. Depending on the message, the system responds by sending out 0 to 5 messages. Figuring out each possible response takes 50 us (microseconds), so if we have to send 5 responses, it takes 250 us.
I'm considering splitting the system up so that each possible response is calculated...
I installed the boost package from cygwin and have a directory /usr/include/boost that includes a bunch of *.hpp files, including thread.hpp, which I need to include in the c++ file, via
#include <boost/thread.hpp>
Also, several *.a files seem to be related to boost::thread.
$ ls /usr/lib/libboost_thread* -1
/usr/lib/libboost_thread-...
All,
Recently I developed a code that supposedly is a thread-safe class. Now the reason I have said 'supposedly' is because even after using the sync'ed blocks, immutable data structures and concurrent classes, I was not able to test the code for some cases because of the thread scheduling environment of JVM. i.e. I only had test cases ...
I noticed that boost does not seem to support semaphores. What's the easiest way to achieve a similar effect?
...
I have an app that needs to send date (using POST) to a server. This function has to be on one of the NavigationController sub-controllers and user should be able to navigate away from this controller and/of close the app (only iPhone4/iOS4 will be supported).
Should I use threads/NSOperations or/and send data using existing asynchronous...
I'm using Eclipse to develop a PyQt application using PyDev. It's using two threads, one for gui and one for network traffic and Eclipse refuse to break on breakpoints set in the network traffic thread, I know it runs because it's throwing exceptions but I can't inspect things which is highly annoying.
Has anybody else experienced simil...
I can't use shutdown() and awaitTermination() because it is possible new tasks will be added to the ThreadPoolExecutor while it is waiting.
So I'm looking for a way to wait until the ThreadPoolExecutor has emptied it's queue and finished all of it's tasks without stopping new tasks from being added before that point.
If it makes any di...
The disadvantage would be in comparison to a technique that was specialized to work on threads that are running within the same process. For example, does wait/post cause the whole process to yield, rather than just the executing thread, even though anyone waiting for a post would be within the same process?
The semaphore would be used,...
I am trying to solve the readers-writers problem with writer preference in Java using multi-threading. The following is a stripped down version of what my code does. Will it work?
public PriorityQueue<myClass> pq;
public void foo(){
myClass obj = new myClass();
pq.add(obj);
obj.wait();
//Actual code
}
public void bar(){
...