Skip to content

Instantly share code, notes, and snippets.

@fabriciorissetto
Last active February 5, 2017 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabriciorissetto/96b9db06f17bd10f4fdd0ab969a83845 to your computer and use it in GitHub Desktop.
Save fabriciorissetto/96b9db06f17bd10f4fdd0ab969a83845 to your computer and use it in GitHub Desktop.
class Program
{
    static void Main()
    {
        var quantidadeThreads = 100;

        for (int i = 0; i < quantidadeThreads; i++)
        {
            new Thread(new ThreadStart(() =>
            {
                //Infinitamente aberta, sempre sincronizando eventos...
                while (true)
                {
                    ObtemEventoDaFilaESincronizaComWebService();
                }
            })).Start();
        }

        Console.ReadLine();
    }

    private static void ObtemEventoDaFilaESincronizaComWebService()
    {
        Console.Write(".");
        Thread.Sleep(2000);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment