Пример #1
0
 public AuroraThreadPool(AuroraThreadPoolStartInfo info)
     {
     m_info = info;
     Threads = new Thread[m_info.Threads];
     Sleeping = new bool[m_info.Threads];
     nthreads = 0;
     }
Пример #2
0
 public AuroraThreadPool(AuroraThreadPoolStartInfo info)
 {
     m_info = info;
     Threads = new Thread[m_info.Threads];
     Sleeping = new int[m_info.Threads];
     nthreads = 0;
     nSleepingthreads = 0;
     // lets threads check for work a bit faster in case we have all sleeping and awake interrupt fails
 }
Пример #3
0
 public AuroraThreadPool(AuroraThreadPoolStartInfo info)
 {
     m_info           = info;
     Threads          = new Thread[m_info.Threads];
     Sleeping         = new int[m_info.Threads];
     nthreads         = 0;
     nSleepingthreads = 0;
     SleepTimeStep    = m_info.MaxSleepTime;
     // lets threads check for work a bit faster in case we have all sleeping and awake interrupt fails
 }
Пример #4
0
        public MaintenanceThread(ScriptEngine Engine)
        {
            m_ScriptEngine = Engine;
            EventManager = Engine.EventManager;

            //There IS a reason we start this, even if RunInMain is enabled
            // If this isn't enabled, we run into issues with the CmdHandlerQueue,
            // as it always must be async, so we must run the pool anyway
            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo();
            info.priority = ThreadPriority.Normal;
            info.Threads = 4;
            info.MaxSleepTime = Engine.Config.GetInt("SleepTime", 300);
            info.Threads = 1;
            threadpool = new AuroraThreadPool(info);

            AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;
        }
Пример #5
0
        public MaintenanceThread(ScriptEngine Engine)
        {
            m_ScriptEngine = Engine;
            EventManager = Engine.EventManager;

            RunInMainProcessingThread = Engine.Config.GetBoolean("RunInMainProcessingThread", false);

            RunInMainProcessingThread = false; // temporary false until code is fix to work with true

            //There IS a reason we start this, even if RunInMain is enabled
            // If this isn't enabled, we run into issues with the CmdHandlerQueue,
            // as it always must be async, so we must run the pool anyway
            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo
                                                 {
                                                     priority = ThreadPriority.Normal,
                                                     Threads = 1,
                                                     MaxSleepTime = Engine.Config.GetInt("SleepTime", 100),
                                                     SleepIncrementTime = Engine.Config.GetInt("SleepIncrementTime", 1),
                                                     Name = "Script Cmd Thread Pools"
                                                 };
            cmdThreadpool = new AuroraThreadPool(info);
            info.Name = "Script Loading Thread Pools";
            scriptChangeThreadpool = new AuroraThreadPool(info);


            MaxScriptThreads = Engine.Config.GetInt("Threads", 100); // leave control threads out of user option
            AuroraThreadPoolStartInfo sinfo = new AuroraThreadPoolStartInfo
                                                  {
                                                      priority = ThreadPriority.Normal,
                                                      Threads = MaxScriptThreads,
                                                      MaxSleepTime = Engine.Config.GetInt("SleepTime", 100),
                                                      SleepIncrementTime = Engine.Config.GetInt("SleepIncrementTime", 1),
                                                      KillThreadAfterQueueClear = true,
                                                      Name = "Script Event Thread Pools"
                                                  };
            scriptThreadpool = new AuroraThreadPool(sinfo);

            AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;
        }
Пример #6
0
        public virtual void RegionLoaded (IScene scene)
		{
            if (!m_Enabled)
                return;

            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo
                                                 {priority = ThreadPriority.Lowest, Threads = 1};
            threadpool = new AuroraThreadPool(info);
            blockthreadpool = new AuroraThreadPool(info);

            scene.EventManager.OnStartupComplete += StartupComplete;
        }
Пример #7
0
        public virtual void RegionLoaded (IScene scene)
		{
            if (!m_Enabled)
                return;

            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo
                                                 {priority = ThreadPriority.Lowest, Threads = 1};
            threadpool = new AuroraThreadPool(info);
            blockthreadpool = new AuroraThreadPool(info);
        }
Пример #8
0
 public AuroraThreadPool(AuroraThreadPoolStartInfo info)
 {
     m_info = info;
     Threads = new Thread[m_info.Threads];
 }
Пример #9
0
        public MaintenanceThread(ScriptEngine Engine)
        {
            m_ScriptEngine = Engine;
            ScriptFrontend = Aurora.DataManager.DataManager.RequestPlugin<IScriptDataConnector>();
            EventManager = Engine.EventManager;

            RunInMainProcessingThread = Engine.Config.GetBoolean("RunInMainProcessingThread", false);

            RunInMainProcessingThread = false; // temporary false until code is fix to work with true

            //There IS a reason we start this, even if RunInMain is enabled
            // If this isn't enabled, we run into issues with the CmdHandlerQueue,
            // as it always must be async, so we must run the pool anyway
            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo();
            info.priority = ThreadPriority.Normal;
            info.Threads = 4;
            info.MaxSleepTime = Engine.Config.GetInt("SleepTime", 300);
            threadpool = new AuroraThreadPool(info);


            MaxScriptThreads = Engine.Config.GetInt("Threads", 100); // leave control threads out of user option
            AuroraThreadPoolStartInfo sinfo = new AuroraThreadPoolStartInfo();
            sinfo.priority = ThreadPriority.Normal;
            sinfo.Threads = MaxScriptThreads + 1;
            sinfo.MaxSleepTime = Engine.Config.GetInt("SleepTime", 300);
            Scriptthreadpool = new AuroraThreadPool(sinfo);

            AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;


        }
Пример #10
0
		public virtual void RegionLoaded (Scene scene)
		{
            if (!m_Enabled)
                return;

            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo();
            info.priority = ThreadPriority.Lowest;
            info.Threads = 1;
            threadpool = new AuroraThreadPool(info);
            blockthreadpool = new AuroraThreadPool(info);

            new MapActivityDetector(scene);

            scene.EventManager.OnStartupComplete += StartupComplete;
        }