Posted on June 23, 2008 by Garbage Collector
A monitor is the most basic synchronization construct.
Any object can have a monitor associated with it, and no monitor can be associated with more than one object.
Monitors have a “lock,” which may be acquired by only one thread at a time. It must be released by that thread before another thread can acquire it.
You can [...]
Filed under: Threading | Tagged: Monitor, Thread | Leave a Comment »
Posted on June 23, 2008 by Garbage Collector
Computer science frequently employs the concept of a watchdog—an entity whose responsibility is to ensure the correct function, or handling of incorrect functions, in another entity. A common pattern is the watchdog timer, usually responsible for making sure that another task completes in a reasonable time.
Console Application
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace pr9
{
class Program
{
static void [...]
Filed under: Threading | Tagged: Thread, Timer, Watchdog | Leave a Comment »
Posted on June 23, 2008 by Garbage Collector
Many times, you will have a slightly different task to perform in each thread and will want to pass each thread a parameter of some sort to differentiate its task from that of the others.
While there are several reasonable ways of doing this, the most straightforward is to create a Task object that holds the [...]
Filed under: Threading | Tagged: Thread, ThreadStart, Worker Class | Leave a Comment »