{"id":301026,"date":"2020-03-31T15:00:17","date_gmt":"2020-03-31T15:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301026"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301026","title":{"rendered":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u043b\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 Java"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495002\/\">\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 Java c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ExecutorService. \u041e\u0431\u0449\u0430\u044f \u0441\u0443\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ol>\n<li> \u041c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438<\/li>\n<li> \u041a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/li>\n<li> \u0418\u0434\u0435\u043c \u043f\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c, \u0441\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u043e\u0434\u0438\u043d<\/li>\n<\/ol>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u0434\u0435\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c, \u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 (\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f).<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"java\">public static String[] merge( String[] leftPart, String[] rightPart ) {         int cursorLeft = 0, cursorRight = 0, counter = 0;         String[] merged = new String[leftPart.length + rightPart.length];         while ( cursorLeft &lt; leftPart.length && cursorRight &lt; rightPart.length ) {             if (leftPart[cursorLeft].compareTo(rightPart[cursorRight] ) &lt; 0 ) {                 merged[counter] = leftPart[cursorLeft];                 cursorLeft+=1;             } else {                 merged[counter] = rightPart[cursorRight];                 cursorRight+=1;             }             counter++;         }         if ( cursorLeft &lt; leftPart.length ) {             System.arraycopy( leftPart, cursorLeft, merged, counter, merged.length - counter );         }         if ( cursorRight &lt; rightPart.length ) {             System.arraycopy( rightPart, cursorRight, merged, counter, merged.length - counter );         }         return merged;     }<\/code><\/pre>\n<p>  <a href=\"https:\/\/gist.github.com\/fedcba98\/10429078\">\u041a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0432\u0437\u044f\u0442 \u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>  \u0421\u0443\u0442\u044c \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0441\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432. \u0426\u0438\u043a\u043b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0439\u0434\u0435\u043c \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u0442\u043e\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0432 \u043d\u0435\u043c \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043c\u0435\u0442\u043e\u0434 run, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0442\u0438\u043f\u0430 Thread \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 start(). \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c executorService. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 merge, \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"java\"> public class Merger implements Runnable{     private String[] unsorted, sorted;     public Merger(String[] unsorted) {         this.unsorted = unsorted;     }      public void run() {         int middle;         String[] left, right;         \/\/ array is sorted         if ( unsorted.length &lt;= 1 ) {             sorted = unsorted;         } else {             \/\/             middle = unsorted.length \/ 2;             left = new String[middle];             right = new String[unsorted.length - middle];             \/\/split array on two             System.arraycopy(unsorted, 0, left, 0, middle);             System.arraycopy(unsorted, middle, right, 0, unsorted.length - middle);             SimpleMerger leftSort = new SimpleMerger(left);             SimpleMerger rightSort = new SimpleMerger(right);             leftSort.sort();             rightSort.sort();             \/\/sort and merge             sorted = SimpleMerger.merge(leftSort.getSorted(), rightSort.getSorted());          }         }     public String[] getSorted() {         return sorted;     } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0447\u0430\u0441\u0442\u0435\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432 java \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0443\u043b\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u041f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0440\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440: \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u0430\u044f \u0434\u0430\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445):<\/p>\n<pre><code class=\"java\"> public static void main(String[] args) throws Exception {         int arrSize = 1_000_000_0;         String[] unsorted = new String[arrSize];         Random randomizer = new Random();          for ( int i = 0; i &lt; arrSize; i++ ) {             unsorted[i] = Integer.toString(randomizer.nextInt( 100_000_0 ));         }          List&lt;Future&gt; futures = new ArrayList&lt;&gt;();         int processorCount = Runtime.getRuntime().availableProcessors();         int batchSize = arrSize\/processorCount;         long startTime = System.currentTimeMillis();         \/\/ create ExecutorService         final ExecutorService executorService = Executors                 .newFixedThreadPool(Runtime.getRuntime().availableProcessors());         ArrayList&lt;Merger&gt; mergers = new ArrayList&lt;&gt;();         for (int i = 0; i &lt; processorCount; i++) {             String[] part = new String[batchSize];             System.arraycopy( unsorted, i*batchSize, part, 0, batchSize );             \/\/ create merger             Merger merger = new Merger(part);              futures.add(executorService.submit(merger));             \/\/add merger to list to get result in future             mergers.add(merger);         }         for (Future&lt;Double&gt; future : futures) {             future.get();         }         executorService.shutdown();         int j = 0;         \/\/ array to get result         String[] mergered = new String[arrSize];         \/\/ sequential merge of all part of array         for (Merger merger:mergers){             if (j == 0) {                 mergered = merger.getSorted();                 j+=1;             }         else{                 String[] part = merger.getSorted();                 mergered = SimpleMerger.merge( mergered, part);             }    }         long timeSpent = System.currentTimeMillis() - startTime;         System.out.println(&quot;Program execution time is &quot; + timeSpent + &quot; milliseconds&quot;);         if (arrSize &lt; 100) {System.out.print(Arrays.toString(mergered));}         startTime = System.currentTimeMillis();         Arrays.sort(unsorted);         timeSpent = System.currentTimeMillis() - startTime;         System.out.println(&quot;\\n Program (non parallel )execution time is &quot; + timeSpent + &quot; milliseconds&quot;);     }<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 10000000. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f batchSize \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f executorService \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0432. <\/p>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 merge, \u0437\u0430\u0442\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u0442\u0430\u0432\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e future \u0436\u0434\u0435\u043c, \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0441\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432. \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c executorService \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  <a href=\"https:\/\/github.com\/Liza1928\/Parallel-merge-sort\">\u041a\u043e\u0434 \u043b\u0435\u0436\u0438\u0442 \u0437\u0434\u0435\u0441\u044c<\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/495002\/\"> https:\/\/habr.com\/ru\/post\/495002\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495002\/\">\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 Java c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ExecutorService. \u041e\u0431\u0449\u0430\u044f \u0441\u0443\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ol>\n<li> \u041c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438<\/li>\n<li> \u041a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/li>\n<li> \u0418\u0434\u0435\u043c \u043f\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c, \u0441\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u043e\u0434\u0438\u043d<\/li>\n<\/ol>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u0434\u0435\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c, \u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 (\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f).<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301026","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301026","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=301026"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301026\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}