multithreading

System.Threading.Tasks - Limit the number of concurrent Tasks

I have just started to look at the new "System.Threading.Tasks" goodness in .Net 4.0, and would like to know if there is any build in support for limiting the number of concurrent tasks that run at once, or if this should be manually handled. E.G: If I need to call a calculation method 100 times, is there a way to set up 100 Tasks, but ...

multi-thread in MS Access, async processing

I know that title sounds crazy but here is my situation. After a certain user event I need to update a couple tables that are "unrelated" to what the user is currently doing. Currently this takes a couple seconds to execute and causes the user a certain amount of frustration. Is there a way to perform my update in a second process or in...

Unresponsive threading involving Swing and AWT-EventQueue

I have an application that is unresponsive and seems to be in a deadlock or something like a deadlock. See the two threads below. Notice that the My-Thread@101c thread blocks AWT-EventQueue-0@301. However, My-Thread has just called java.awt.EventQueue.invokeAndWait(). So AWT-EventQueue-0 blocks My-Thread (I believe). My-Thread@101c,...

C# Threads.Abort()

If a thread is running a function func1 that calls another function func2 inside it... Then I called thread.Abort() Will this stop func1 only OR func1 and func2 and all the functions func1 has called?? Thanks Edit: Here are more detail: func1 is called in a new thread, it continuously calls func2 on regular basis... func2 begin do...

[C++] Producer/Consumer Implementation -- Feedback Wanted

I'm preparing for an interview in a few weeks and I thougth I would give threads in boost a go, as well as do the simple producer/consumer problem I learned in school. Haven't done it quite awhile so I was curious what you guys think of this? What should I add to make it a better example etc. Thanks for the feedback! :) ///////////////...

Checking stack size in C#

Is there a way to check threads stack size in C#? ...

Problem with stackless python, cannot write to a dict

I have simple map-reduce type algorithm, which I want to implement in python and make use of multiple cores. I read somewhere that threads using native thread module in 2.6 dont make use of multiple cores. is that true? I even implemented it using stackless python however i am getting into weird errors [Update: a quick search showed t...

Threading vs single thread

Is it always guaranteed that a multi-threaded application would run faster than a single threaded application? I have two threads that populates data from a data source but different entities (eg: database, from two different tables), seems like single threaded version of the application is running faster than the version with two thre...

handling activity destruction in multithreaded android app

Hi, I have a multithreded app where background threads are used to load data over network or from disk/db. Every once in a while user will perform some action e.g. fetch news over network, which will spawn a background AsyncTask, but for some reason user will quit the app (press back button so that activity gets destroyed). In most such...

WCF Service method synchronous/async

Hi I have a problem with calling WCF Service methods with Silverlight 3. private bool usr_OK = false; clientService.CheckUserMailAsync(this.mailTF.Text); if (usr_OK == true) { isValidationOK = true; } else { isValidationOK = false; MessageBox.Show("User already exists.", "User registered succes!", MessageBoxButton.OK); } CheckUs...

Wpf progressbar not updating during method calculation

Hey guys, In my app, i have an import option, to read info from a .csv or .txt file and write it to a database. To test, i"m just using 200-300 lines of data. At the beginning of the method, i calculate number of objects/lines to be read. Every time an object is written to the database, i want to update my progressbar. This is how i do ...

Creating Threads in python

Hello, I have a script and I want one function to run at the same time as the other. Example code I have looked at: import threading def MyThread ( threading.thread ): doing something........ def MyThread2 ( threading.thread ): doing something........ MyThread().start() MyThread2().start() I am having trouble getting this ...

Mutithreading in Win32

is there any good book/video/web tutorials for multithreading in win32? I only found Addison-Wesley - Multithreading Applications in Win32 (1996) book and might going to order it soon. ...

Correct way to do timer function in Python

Hi. I have a GUI application that needs to do something simple in the background (update a wx python progress bar, but that doesn't really matter). I see that there is a threading.timer class.. but there seems to be no way to make it repeat. So if I use the timer, I end up having to make a new thread on every single execution... like : ...

Pros and cons with a ready-queue for diffrent semaphores in a mini OS.

In a OS we originally have a ready-queue for the threads, note only one queue. Why would it be better to have different queues for each semaphore. Pros and cons can be about efficiency, complexity or something else. ...

Referenced assembly won't load in new thread on IIS 7

I have a process in which a user uploads a file to a web site where the file is then processed and uploaded into the database. The process of validating the file could take several minutes so as soon as the file is uploaded I create a new thread and I do my processing on this second thread. This works great on my local machine but does...

Threading and cores

If I have X cores on my machine and I start X threads. Let's assume for the sake of argument that each thread is completely separated in terms of the memory, hdd, etc it uses. Is the OS going to know to send each thread to a core or do more time slicing on one core for multiple threads. What the question boils down to, is if I have X co...

LINQ Changeset multi-threading

I'm using LINQ to SQL and after I submit some changes I want to spawn a thread which looks through all the changes and updates our lucene index as necessary. My code looks vaguely like: (new Thread(() => { UpdateIndex(context.GetChangeSet()); }).Start(); Sometimes though I get an InvalidOperationException, which I think is because con...

How do you play an MP3 in Visual Basic.NET without delay?

I'm working on a game that plays MP3s at various points using the Windows Media Player component and it takes a long time to load and play MP3s. Would anyone know how to decrease the load time? I've considered multi-threading but I'm not sure how I would do that or if that's even the proper direction. ...

TerminateProcess and deadlocks

Is it real that the TerminateProcess function in Windows could hang because the threads inside the process were stuck in a deadlock? Example: Process A is running under Process B's control, now Process A gets into a deadlock and Process B detects this and decides to 'Kill' process A using TerminateProcess. Would it be successful in ki...