public void StartCreator(int threads) { _threadManager.StopAll(); for (int i = 0; i < threads; i++) { _threadManager.CreateThread(CreateDot); } _threadManager.StartAll(); }
public bool CreateThread(string name, Guid?creatorID) { try { IThreadManager m = ThreadManagerFactory.ThreadManager(); return(m.CreateThread(name, creatorID)); } catch (Exception ex) { throw new FaultException(ex.Message + "\n" + ex.StackTrace); } }
static void Main(string[] args) { IThreadManager m = ThreadManagerFactory.ThreadManager(); m.CreateThread("Test Thread", null); //IForumUnitOfWork uow = ForumUOWFactory.ForumUnitOfWork(); //uow.UserRepository.Create(new User { Username = "******" }); //uow.SaveChanges(); ////uow.PostRepository.Create(new Post { Content = "Hello!!" }); ////uow.SaveChanges(); //List<Post> posts = uow.PostRepository.All().ToList(); //foreach(Post p in posts) //{ // Console.WriteLine(p.Content); //} //Console.ReadLine(); //ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); //ShowPosts(client.GetPosts().ToList()); //string input = Console.ReadLine(); //while (input != "exit") //{ //// bool added =client.AddPost(input); // if(added) // { // ShowPosts(client.GetPosts().ToList()); // } // input = Console.ReadLine(); //} }
public void StartDrawing() { _threadManager.CreateThread(DoWorker); _threadManager.StartAll(); }
private void ExecuteAssemblyWithArguments(IFunctionName moduleFunction, byte[] arguments, bool waitForThreadExit) { _threadManager.CreateThread(moduleFunction.Module, moduleFunction.Function, arguments, waitForThreadExit); }