Как разместить myelasticbeanstalk.com/client как www.MYDOMAIN.com и myelasticbeanstalk.com/admin как admin.MYDOMAIN.com настроить через .ebextensions?

Для запуска параллельных методов, которые не зависят друг от друга ThreadPool.QueueUserWorkItem также можно использовать. Вот пример метода -

public static void ExecuteParallel(params Action[] tasks)
{
    // Initialize the reset events to keep track of completed threads
    ManualResetEvent[] resetEvents = new ManualResetEvent[tasks.Length];

    // Launch each method in it's own thread
    for (int i = 0; i < tasks.Length; i++)
    {
        resetEvents[i] = new ManualResetEvent(false);
        ThreadPool.QueueUserWorkItem(new WaitCallback((object index) =>
            {
                int taskIndex = (int)index;

                // Execute the method
                tasks[taskIndex]();

                // Tell the calling thread that we're done
                resetEvents[taskIndex].Set();
            }), i);
    }

    // Wait for all threads to execute
    WaitHandle.WaitAll(resetEvents);
}

. Более подробно об этой функции можно найти здесь: http://newapputil.blogspot.in/2016/03/running-parallel-tasks-using .html

0
задан Huzaifah Sulaiman 16 January 2019 в 18:14
поделиться