What is TaskGarden?
TaskGarden is a multi-process architecture.
It takes threading and translates it into processes.
It's a bit like COM+ but completely .NET. It's a bit like COM+ but without the weird idiosyncrasies. It's a bit like COM+ but without so many names*.
Perhaps the closest .NET product to TaskGarden is the Windows Communication Foundation (WCF) provided by Microsoft. However if you have ever used WCF you will know how incredibly heavy and complicated it is. If you have a year to spare then by all means go for WCF. If not then TaskGarden is lightweight, portable and functional. It concentrates on getting the job done.
Normally you would write some code and spawn it off into a separate thread. With TaskGarden you write some code and spawn it off into a separate process. This helps you in a variety of ways.
Solve Permissions Issues
How much would you give never to have to deal with permissions issues again?
This was the chief motivation behind the creation of TaskGarden. We deal with lots of permissions issues and they make our lives a nightmare. We wanted something that we could use which would effectively eliminate any permissions problems. Yes you still need to take responsibility for assigning appropriate permissions but with TaskGarden it is easy to assign those permissions to particular tasks.
TaskGarden allows you to segment your tasks so that you can run different tasks under different user accounts. It's like impersonation but it works 100%. Because each task gets a dedicated process there are no unhappy second class citizens like there are using traditional impersonation.
If you have three lines of code that need to be called from ASP.NET as 'Bill Gates' then you can really do this. You're not going to get conflicts between the main thread and your subsidiary thread. You're not suddenly going to lose your impersonation token because your code has been spawned into a new thread.
Make Your Solutions More Scalable
Wouldn't it be nice if all code was developed to be safely callable from multiple threads?
However with traditional multi-threaded programming, program flow becomes exponentially more difficult to understand. An error in thread synchronization often results in a catastrophic failure. Because writing thread safe code is difficult, such failure is common.
Because threading errors are so dangerous, sync sections are often overused and lock down far too much. So although you may be using multiple threads, you may find that the scalability of your solution is effectively the same as that you would get from a single thread.
TaskGarden solves this problem simply and easily by running your code in multiple processes to provide a similar level of scalability that you would expect from a true multi-threaded application.
Multithreading - even if your application was never designed for it.
Eliminate 32/64 Bit Issues & Increase Stability
All you need to do is write code to perform a task.
When you run your code TaskGarden will automatically run the code in a process of the correct bitness.
So if you have legacy 32 bit DLLs you want to call from a 64 bit process then you want TaskGarden.
When you run your task TaskGarden will automatically put your code into a separate process.
Normal everyday exceptions will cross the process boundary and can be handled by your calling code.
Fatal unhandlable exceptions are handled in a "fail-fast" manner and simply result in the child process being quietly terminated. Your code is left unaffected and can either report an error or retry the operation.
And the beauty...
And the beauty of all of this is that it all happens invisibly. It just works.
The Examples folder in the installation directory contains two complete example projects.
CalculatorApp and OldCalculator show a simple example of loading an old buggy legacy executable via TaskGarden. They show how 32 bit code can be called from a 64 bit process. They show how a fatal crash in the legacy 32 bit code becomes a simple error in the calling code.
MultiProcessBrowser is a Web browser application in which each tab runs in its own worker process. Like Google Chrome but in your own application using only a few lines of code. This is an example of performing explicit, fine grained management using a sophisticated approach.
* COM+ has been marketed under a variety of names. Originally it was Microsoft Transaction Server - MTS, then COM+ and then .NET Enterprise Services. You can see it entitled Component Services in your Windows Administrative Tools folder. Despite all the names, essentially it is and always has been the same thing.