multithreading

What kind of processes and threads does iPhone OS create when launching an app?

When an app launches, I assume iPhone OS creates exactly one process for that, with exactly one thread (the main thread). Is that correct? Or are there more threads or even more processes that come along automatically with an launched app? ...

What's the real point and benefit of having an Run Loop?

When reading the apple docs about multithreading, they talk a lot about Run Loops. What's the point of creating a Run Loop? Is that for re-using a user thread multiple times? In which exemplary situations is a Run Loop a good idea? How does this Run Loop relate to a thread? Lets take as an example the main run loop of an iPhone OS app. ...

Can I run a Thread multiple times?

Hi guys it's me again this is my Problem : I have a stack of threads , each thread will do its job and then return to the stack at the first time the thread is working well after it finishes the job if I want to pop it from the stack to run again : Exception will appear which said this thread is running or terminated can't be restarted ....

Question about modal forms and threads

Hey, In the main thread I need to do the following: Create a second thread where I'll show a modal form that will act as an "activity indicator" Start a task (this task MUST be executed from the main thread) Close the modal form created in the second thread. The question is that I don't know how to show a modal form and not stop the...

How to use thread pool in WebLogic 8?

How is it possible to get/use/return a thread from an execute queue ( = thread pool) in WebLogic 8.1.6? ...

Mutex lock on write only

I have a multithreaded C++ application which holds a complex data structure in memory (cached data). Everything is great while I just read the data. I can have as many threads as I want access the data. However the cached structure is not static. If the requested data item is not available it will be read from database and is then in...

Consecutive threads in Java

Greetings, I'm trying to solve the following task: Given N threads, make them run consecutively. For example each of them should output it's number in the following order: Thread 1 Thread 2 ... Thread N How do I do this, using only wait/notify and synchronized methods (without flags, etc)? P.S. Sorry for my poor english :) ...

Separate UI thread for details view using WinForms

Our app's master/details view uses a datagridview as the master, and a custom control as the details view. The details view takes a long time to compute and render, making cursoring up/down the master view painfully slow. Therefore, we'd like the details view to run asynchronously (in a separate UI thread) with change notifications from...

[Python] Exit a process while threads are sleeping

In a python script, I started a bunch of threads, each of which pulls some resource at an interval using time.sleep(interval). I have another thread running, which uses the cmd module to monitor user inputs. When the user enters 'q', I call sys.exit(0) However, when the script is running and I enter 'q', the thread user input monitori...

With modern OS schedulers, does it still make sense to manually lock processes to specific CPUs/cores?

I recently learned that sometimes people will lock specific processes or threads to specific processors or cores, and it's thought that this manual tuning will best distribute the load. This is a bit counter-intuitive to me -- I would think the OS scheduler would be able to make a better decision than a human about how to spread the load...

Why is "lock (typeof (MyType))" a problem?

MSDN gives the following warning about the lock keyword in C#: In general, avoid locking on a public type, or instances beyond your code's control. The common constructs lock (this), lock (typeof (MyType)), and lock ("myLock") violate this guideline: * lock (this) is a problem if the instance can be accessed publicly. * ...

using ThreadPool

Hi it's me again my Question is : I am trying to work with multi threading TECHNIC so I used threadPool but what I want is the following I want to identify the size of the ThreadPool when the program is launching when I have Data to manage , I will take a thread from The ThreadPool to work with this Item, as I have read you can define it...

Best way to run a simple function on a new Thread?

I have two functions that I want to run on different threads (because they're database stuff, and they're not needed immediately). The functions are: getTenantReciept_UnitTableAdapter1.Fill(rentalEaseDataSet1.GetTenantReciept_Unit); getTenantReciept_TenantNameTableAdapter1.Fill(rentalEaseDataSet1.GetTenantReciep...

Synchronising access to an object that multiple threads can access

My question is partially inspired by this article written by Eric Lippert: http://blogs.msdn.com/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx Using Eric's example of a Queue class being accessed by multiple threads. If I have two distinct pieces of code that access the queue: class MyThreadTest { pr...

.NET Multithreading Syncronization

Quick version of my question: Is the only time you need to use "lock" when you are accessing the same instance of an object? For example, if i am instantiating everything new within my thread entry method, do I have to worry about locking any objects? Detailed Explanation of my question: My scenario is, I have a work object with a ...

testing threaded code in ruby

I'm writing a delayed_job clone for DataMapper. I've got what I think is working and tested code except for the thread in the worker process. I looked to delayed_job for how to test this but there are now tests for that portion of the code. Below is the code I need to test. ideas? (I'm using rspec BTW) def start say "*** Starting...

How to implement divide and conquer algorithms in C# using multithreading?

I am new to C# and multithreading. How do I write programs for divide and conquer algorithms like merge sort or quick sort in C# using multithreading? ...

.NET - multi-threaded iteration over a single List (Of T) - What do I need to watch out for?

I'm using VB.NET. I want to build a large List (Of MyClassOrStructure) that becomes static after its initial population. I'm going to have multiple threads that need to iterate through this list to read data (no writing, inserting, or deleting) Are there any very bad things that I need to keep an eye out for? Thanks. ...

Multithreading in c# how to use?

Hi, I never work with multithreading in c#. Can some body give me a simple code example to do this? (c# with asp.net web application) My intention is i want to read 10 values at a same time. So I'm going for multithreading concept. Is it right thing what I choose? Or is there any best way to approach? Thank you, nagu ...

DirectShow on multiple machines with wcf

Is it any how possible to run DirectShow on multiple machines with wcf? ...