1
0

STPStartInfo.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // Ami Bar
  2. // [email protected]
  3. using System.Threading;
  4. namespace Amib.Threading
  5. {
  6. /// <summary>
  7. /// Summary description for STPStartInfo.
  8. /// </summary>
  9. public class STPStartInfo : WIGStartInfo
  10. {
  11. /// <summary>
  12. /// Idle timeout in milliseconds.
  13. /// If a thread is idle for _idleTimeout milliseconds then
  14. /// it may quit.
  15. /// </summary>
  16. private int _idleTimeout;
  17. /// <summary>
  18. /// The lower limit of threads in the pool.
  19. /// </summary>
  20. private int _minWorkerThreads;
  21. /// <summary>
  22. /// The upper limit of threads in the pool.
  23. /// </summary>
  24. private int _maxWorkerThreads;
  25. /// <summary>
  26. /// The priority of the threads in the pool
  27. /// </summary>
  28. private ThreadPriority _threadPriority;
  29. /// <summary>
  30. /// If this field is not null then the performance counters are enabled
  31. /// and use the string as the name of the instance.
  32. /// </summary>
  33. private string _pcInstanceName;
  34. private int _stackSize;
  35. public STPStartInfo() : base()
  36. {
  37. _idleTimeout = SmartThreadPool.DefaultIdleTimeout;
  38. _minWorkerThreads = SmartThreadPool.DefaultMinWorkerThreads;
  39. _maxWorkerThreads = SmartThreadPool.DefaultMaxWorkerThreads;
  40. _threadPriority = SmartThreadPool.DefaultThreadPriority;
  41. _pcInstanceName = SmartThreadPool.DefaultPerformanceCounterInstanceName;
  42. _stackSize = SmartThreadPool.DefaultStackSize;
  43. }
  44. public STPStartInfo(STPStartInfo stpStartInfo) : base(stpStartInfo)
  45. {
  46. _idleTimeout = stpStartInfo._idleTimeout;
  47. _minWorkerThreads = stpStartInfo._minWorkerThreads;
  48. _maxWorkerThreads = stpStartInfo._maxWorkerThreads;
  49. _threadPriority = stpStartInfo._threadPriority;
  50. _pcInstanceName = stpStartInfo._pcInstanceName;
  51. _stackSize = stpStartInfo._stackSize;
  52. }
  53. public int IdleTimeout
  54. {
  55. get { return _idleTimeout; }
  56. set { _idleTimeout = value; }
  57. }
  58. public int MinWorkerThreads
  59. {
  60. get { return _minWorkerThreads; }
  61. set { _minWorkerThreads = value; }
  62. }
  63. public int MaxWorkerThreads
  64. {
  65. get { return _maxWorkerThreads; }
  66. set { _maxWorkerThreads = value; }
  67. }
  68. public ThreadPriority ThreadPriority
  69. {
  70. get { return _threadPriority; }
  71. set { _threadPriority = value; }
  72. }
  73. public string PerformanceCounterInstanceName
  74. {
  75. get { return _pcInstanceName; }
  76. set { _pcInstanceName = value; }
  77. }
  78. public int StackSize
  79. {
  80. get { return _stackSize; }
  81. set { _stackSize = value; }
  82. }
  83. }
  84. }