About Java multithreaded Network programming Considerations! __ Programming

Source: Internet
Author: User

1. In the context of multithreading, we must pay attention to the problem of synchronization. I have encountered, the program at the beginning of the run, multiple threads read the same configuration file, the following problems occurred: FWK005 parse May is called while parsing.

2. It is important to note that server-side connection with the client, if the server side unexpectedly with the client connected, there may be, server-side has been providing services to clients, resulting in suspended animation, or CPU occupancy rate suddenly become higher. I have encountered, when the client disconnected, the server-side provided the thread is still running, resulting in high CPU usage.

3. Some class sets such as map, is not multi-threaded security, it is necessary to use, collections.synchronized*** the corresponding method to make it into a safe.

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.