//--------------------------------------------------------------------------
        public bool Initialize()
        {
            if (!_workerThread.Start())
            {
                return(false);
            }

            return(_workerThread.PostTask(_ => {
                try {
                    DatabaseConnectionService.Instance.Initialize();
                    try {
                        WordsService.Instance.Initialize();
                        CollectStats();
                    } catch (Exception) {
                        // ignore it because we might have an empty DB
                    }

                    GlobalParamatersService.Delegate.OnInitializationComplete(
                        true, null);
                } catch (Exception e) {
                    GlobalParamatersService.Delegate.OnInitializationComplete(
                        false, e.Message);
                }
            }));
        }
        private ThreadingService()
        {
            DBThread = new ThreadWorkerQueue("Database Thread");
            if (!DBThread.Start())
            {
                throw new Exception("Couldn't start DB Thread!");
            }

            IOThread = new ThreadWorkerQueue("IO Thread");
            if (!IOThread.Start())
            {
                throw new Exception("Couldn't start DB Thread!");
            }
        }