multithreading

c# threading

Can anyone direct me to a good C# (or general) threading tutorial/article/blog? Im being asked to design a multi threaded application and I suddenly realised, that I don't really know anything about ...

pthread-like windows manual-reset event

is there any easier solution in porting a windows manual-reset event to pthread, than a pthread conditional-variable + pthread mutex + a flag if event is set or unset? ...

Java threads: Is it possible view/pause/kill a particular thread from a different java program running on the same JVM?

I have a program 'foo' running different threads, fooT1, fooT2, .. fooTn. Now if I want write another program 'bar', which could kill the thread fooTr, is that possible? Reason: One of the thread fooTr tracks product license. If this thread is killed; one may run this product indefinitely. And killing 'foo' itself is tolerable as 'foo'...

Thread synchronization question (in java)

Hello, my java application has a loading task which requires two server calls which can be parallelized. So I launch a Thread t1 (doing task1) and a Thread t2 (for task2). I want then to do a specific task, task3 when both other tasks (1 & 2) are over. Naturally I can't tell which of task1 and task2 will finish first... Which would be f...

Java: Swing Libraries & Thread Safety

I've often heard criticism of the lack of thread safety in the Swing libraries. Yet, I am not sure as to what I would be doing in my own code with could cause issues: In what situations does the fact Swing is not thread safe come into play ? What should I actively avoid doing ? ...

What is the best practice for JPA/Hibernate entity classes and synchronization?

It seems like most examples of JPA/Hibernate entity bean classes I've seen do no explicit synchronization. Yet, it is possible to call getters/setters on those objects in the context of building up a transaction. And it's possible for those methods to be called across multiple threads (although maybe that's unusual and weird). It se...

Serialization of objects: no thread state can be involved, right?

I am looking hard at the basic principles of storing the state of an executing program to disk, and bringing it back in again. In the current design that we have, each object (which is a C-level thingy with function pointer lists, kind of low-level home-made object-orientation -- and there are very good reasons for doing it this way) wi...

NSAutoreleasePool in NSOperation main?

The documentation for +[NSThread detachNewThreadSelector:toTarget:withObject:] says: For non garbage-collected applications, the method aSelector is responsible for setting up an autorelease pool for the newly detached thread and freeing that pool before it exits. My question is, do I need to create my own NSAutoreleasePool in ...

Is EPiServer threadsafe?

I can't find any information about this on either www.episerver.com or world.episerver.com, anyone knows? ...

How to synchronize the access to a List<T> used in ASP.NET

Hi, I have some problems on a site with the concurrent access to a list. This list keeps a cart of items, and multiple deletes are crashing the site. Which is the best method to sync them? Is a lock enough? The lock option seems to be ugly because the code is spread all over the place and is pretty messy. Update: This is a list impleme...

Get Visual Studio to throw exceptions across threads

In my Silverlight project I have a thread that fires every x milliseconds. In this thread I was attempting to change the state of the application. This wasn't working and I didn't know why, so put a breakpoint in to the Timer callback. The breakpoint was hit, but the minute I attempted to change the state it just bailed out of the functi...

Tools for finding Shared Mutable data bugs in Java

I have a large legacy system to maintain. The codebase uses threads all over the place and those threads share a lot of mutable data. I know, sounds bad. Anyway, don't answer "rewrite the whole application from scratch" or I'll vote you down :-) I have tried to run some static analysis tools on the codebase, but none of those seem to cat...

Can not operate ObservableCollection in multi threads

It seems the ObservableCollection only support add, remove, clear operation from the UI thread, It throw Not Support Exception if it is operated by a NO UI thread. I tried to override methods of ObservableCollection, unfortunatly, I met lots of problems. Any one can provide me a ObservableCollection sample which can be operated by multi-...

Do I need to protect read access to an STL container in a multithreading environment?

I have one std::list<> container and these threads: One writer thread which adds elements indefinitely. One reader/writer thread which reads and removes elements while available. Several reader threads which access the SIZE of the container (by using the size() method) There is a normal mutex which protects the access to the list fro...

Recursive Lock (Mutex) vs Non-Recursive Lock (Mutex)

POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also support recursive mutexes, but if they want to be POSIX conform, they have to. Other APIs ...

HTTP posts and multiple threads in Java

I am writing an internal Java Applet to do file uploads via HTTP. I started using the built in ClientHttpRequest which worked great if I want to post one after another. When I try to have multiple threads post at the same time, something on the server side freaks out and the connection will hang for large files while still uploading th...

catching exceptions from another thread

I have a method running in a seperate thread. The thread is created and started from a form in a windows application. If an exception is thrown from inside the thread, what is the best way to pass it back to the main application. Right now, I'm passing a reference to the main form into the thread, then invoking the method from the thr...

What is the best way to learn more about imperative-style concurrent programming?

Have had to write my first "proper" multithreaded coded recently, and realised just how little I knew about how "imperative-style" (ie, concurrency models used by C++/C#/Java, and the like) concurrent programming techniques. What resources are there (both books and online tutorials, etc) in order to learn more about this area of coding-...

Daemon Threads Explanation

In the Python documentation: http://www.python.org/doc/2.5.2/lib/thread-objects.html it says: "A thread can be flagged as a ``daemon thread''. The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread." Does anyone have a clearer exp...

Java: Threading Techniques & Concepts

When using threads I sometimes visualise them as weaving together 3 or more dimensional interconnections between Objects in a Spatial context. This isn't a general use case scenario, but for what I do it is a useful way to think about it. Are there any APIs which you use which aid threading? Have you used threads in a manner which doe...