Program.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace Eserciziotep4
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Gestione_File.MakeDirecotry();
  14. Thread th2 = new Thread(new ThreadStart(GestioneThread.Scrivin));
  15. Thread th = new Thread(new ThreadStart(GestioneThread.Leggi));
  16. th.Name = "leggi";
  17. //th1.Name = "scrivi n";
  18. th2.Name = "scrivi c";
  19. th2.Start();
  20. /*
  21. th1.Start();
  22. th.Start();
  23. th2.Join();
  24. th1.Join();
  25. th.Join();
  26. while (!(th2.IsAlive) && !(th.IsAlive))
  27. {
  28. Thread.Sleep(1000);
  29. }
  30. */
  31. Thread.Sleep(1000);
  32. th2.Join();
  33. /*
  34. th1.Start();
  35. th1.Join();
  36. */
  37. th.Start();
  38. Thread.Sleep(1000);
  39. th.Join();
  40. Console.ReadKey();
  41. }
  42. }
  43. }