Spring uses threadlocal technology to address these issues

Source: Internet
Author: User

I used to think from left to right, because it fits the habit of writing, for "good" front-end engineers, we might first think about what is good, good definition and scope, standards and requirements? But now I'm used to thinking from right to left, because I think the more abstract it is, the more difficult it is to define it, and the easier it is to find the path to solving the problem, starting with smaller nouns.

After some trials and comparisons, the old week found a kind of a good plan, the focus is that the program is relatively simple, no need to break five hurdles, as long as you have some basis for data binding good.

OK, f talk less, let's get started.

There are not so many photos in your hand, so use the same picture to test it. Suppose I want to load 20,000 pictures while the application is running, I think 2W should be able to, never seen who would be silly to load 100W Zhang so perverted.

On the problem of multi-thread sharing, the synchronization mechanism adopts "time-changing space, access serialization, object Sharing". And Threadlocal is "to space for time, access parallelism, the object of exclusive." The former provides only one copy of the variable, allowing different threads to queue access, and the latter provides a variable for each thread, so it can be accessed at the same time without affecting each other.

Of course, some friends may say that the actual application of the number of images uploaded at a time is not too much, consider these questions is not a little more than the worry, well, if you really think so can ignore this series of articles.

The actual demand is basically in accordance with the original image of the aspect ratio compression, directly specify the size of the comparison is rare, so this series of articles is also for this ratio compression.

Programmers often have the need to find strings that match certain complex rules when writing program pages that handle strings. Regular expressions are the tools used to describe these rules. In other words, the regular expression is the code that records the text rules. It is more accurate than a wildcard to describe your needs. Of course there is no free lunch, and we want to achieve more accurate data and we need to know more about the regular.

Recently, when doing DB optimization, a stored procedure was found to have a very serious performance problem.

Because the whole SP overall logic is a complex query with multiple table associations, the overall structure is more complex, through the analysis and attempt,

Finally, the problem is found in one of the large tables of the implementation of the query on the way,

Because the unexpected execution of this large table causes other tables to be unable to be driven, other tables are also table-scanned ways to participate in join

Results in a series of extremely inefficient execution results (unreasonable execution plan) resulting from joins and queries compiled between the entire table behind

This is said in the sort method of the array in high 3, where the sort () method can receive a comparison function as an argument to specify which value is in front of which value.
The comparison function receives two parameters, returns a negative number if the first argument should precede the second argument, returns 0 if the two arguments are equal, or returns a positive number if the first parameter should be located after the second argument.

Spring uses threadlocal technology to address these issues

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.