A Philosopher class that demonstrates per-session logging.
Inheritance Hierarchy
LaurelBridge.DCFExamples.DiningPhilosophersWorkerThread
LaurelBridge.DCFExamples.DiningPhilosophersPhilosopher
Namespace: LaurelBridge.DCFExamples.DiningPhilosophers
Assembly: DiningPhilosophers (in DiningPhilosophers.exe) Version: DCF34 r13043 DCF_3_4_56_20220408 NetFramework
Syntax
C#
public class Philosopher : WorkerThread
The Philosopher type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Philosopher |
Constructor.
|
Methods
Name | Description | |
---|---|---|
Run |
Run method override.
(Overrides WorkerThreadRun.) |
Remarks
Each philosopher has a DicomSessionSettings instance. As a given philosopher does work, the log messages are written to a file whose filename corresponds to the SessionId property of that session. The log output will contain a log file for each session, as well as a default session log.
Credit for this dining philosophers solution goes to Bob Powell:
http://www.java2s.com/Tutorial/CSharp/0420__Thread/DiningPhilosopher.htm
Note |
---|
No philosophers were harmed in the implementation of this example. |
See Also