tailieunhanh - Light Point Apress Introducing dot NET_1

Visual Studio 2010 được thiết kế để cung cấp cho bạn với lộ trình đó. Nó phục vụ như một lớp sơn lót không vô nghĩa, sẽ giúp kinh nghiệm phát triển NET hiểu tác động của các khuôn khổ mới và công nghệ liên quan. Cuốn sách này sẽ giữ cho bạn cập nhật những thay đổi và giúp bạn nắm bắt cơ hội mới tự tin và nhanh chóng. | CHAPTER 5 PARALLELIZATION AND THREADING ENHANCEMENTS factorials or walk trees of data but I think this distracts at least initially from understanding the basics. If you want to work with a more realistic example take a look at the examples from the parallel team you will find excellent ray tracing and other math related examples. Note that calling the method will involve a context switch an expensive operation for the CPU so it might slow the sample application down more than performing work might have. 1. Create a new console application called add the following using directives using using 2. Amend to the following code class Program . . public static List StockQuote Stocks new List StockQuote static void Main string args . double serialSeconds 0 double parallelSeconds 0 Stopwatch sw new Stopwatch PopulateStockList sw RunInSerial serialSeconds sw RunInParallel parallelSeconds Finished serial at 0 and took 1 serialSeconds Finished parallel at 0 and took 1 parallelSeconds private static void PopulateStockList new StockQuote ID 1 new StockQuote ID 2 new StockQuote ID 3 new StockQuote ID 4 new StockQuote ID 5 new StockQuote ID 6 Company Microsoft Price Company IBM Price Company Yahoo Price Company Google Price Company Altavista Price Company Ask Price 102 CHAPTER 5 PARALLELIZATION AND THREADING ENHANCEMENTS new StockQuote ID 7 Company Amazon Price new StockQuote ID 8 Company HSBC Price new StockQuote ID 9 Company Barclays Price new StockQuote ID 10 Company Gilette Price private static void RunInSerial for int i 0 i i 7 . . .

TỪ KHÓA LIÊN QUAN