C # simple Multithreading

Source: Internet
Author: User

This log is quite useful. If you cannot think of it, you can flip it over and record it in the future. C # simple multithreading has been used before, but now it feels strange... I checked it again today and kept a record.

Private void layoutroot_sizechanged (Object sender, sizechangedeventargs e) {// use object to pass the parameter thread loadmap = new thread (New parameterizedthreadstart (loadmapasync); loadmap. start (17); // Asynchronous Method without parameters thread loadmap2 = new thread (New threadstart (loadmapasync2); loadmap. start () ;}// convert the void loadmapasync (Object PARAM) {int level = (INT) Param; while (mapserverhelper. getstartpos (level )! = NULL) loadmap (mapserverhelper. getstartpos (level);} // directly execute the code void loadmapasync2 () {While (mapserverhelper. getstartpos (0 )! = NULL) loadmap (mapserverhelper. getstartpos (0 ));}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.