{"id":228647,"date":"2014-07-04T09:44:03","date_gmt":"2014-07-04T05:44:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=228647"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=228647","title":{"rendered":"<span class=\"post_title\">Lock-free Round Robin<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435.<\/p>\n<p>  \u0414\u0430\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u0438\u043b\u0438 \u0440\u0443\u043a\u0438. \u0414\u0430 \u0438 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u041e\u0434\u043d\u0430\u0436\u0434\u044b, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u043f\u0443\u043b\u0443. <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/h4>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c round robin, \u043a\u0430\u043a \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0446\u0438\u0442\u0430\u0442\u0430 \u0438\u0437 wiki:  <\/p>\n<blockquote><p>Round-robin (\u043e\u0442 \u0430\u043d\u0433\u043b. round-robin \u2014 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439) \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u0438\u044f \u0435\u0451 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u043c\u0443 \u0446\u0438\u043a\u043b\u0443.<\/p><\/blockquote>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u0432 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/111613\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>. \u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0439\u0442\u0438 \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043f\u0443\u0442\u0438. \u041d\u0430\u043f\u0438\u0441\u0430\u0432 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u043f\u043e\u0434\u043e\u0431\u0438\u0435 linked list&#8217;a \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0414\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 ConcurrentLinkedQueue \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 AtomicReference. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 Node.<\/p>\n<pre><code class=\"java\">  private static class Node&lt;T&gt; {         private T element;         private Node&lt;T&gt; next;          private Node(T element) {             this.element = element;         }          public void setNext(Node&lt;T&gt; next) {             this.next = next;         }     } <\/code><\/pre>\n<p>  \u041d\u0443\u0436\u043d\u043e \u044d\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 Linked \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438. \u0412 \u043e\u0431\u0449\u0435\u043c \u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442, \u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043c\u043e\u0433\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430.<\/p>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u043b\u0435\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u041d\u0435 \u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u044f \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e 4 \u043f\u043e\u043b\u044f first,last,current \u0438 size.  <\/p>\n<ul>\n<li>first \u2014 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/li>\n<li>last \u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438<\/li>\n<li>current \u2014 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u0435\u043d \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443.<\/li>\n<li>size \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.<\/li>\n<\/ul>\n<pre><code class=\"java\">    private AtomicInteger size = new AtomicInteger(0);     private AtomicReference&lt;Node&lt;T&gt;&gt; first = new AtomicReference&lt;Node&lt;T&gt;&gt;();     private AtomicReference&lt;Node&lt;T&gt;&gt; current = first;     private AtomicReference&lt;Node&lt;T&gt;&gt; last = new AtomicReference&lt;Node&lt;T&gt;&gt;(); <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043c\u0435\u0442\u043e\u0434\u0430\u043c. \u041b\u043e\u0433\u0438\u0447\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u0435 \u00ab\u043a\u043e\u043b\u044c\u0446\u043e\u00bb \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043f\u043e\u0442\u043e\u043c \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 put \u0438 next.<\/p>\n<pre><code class=\"java\">public void put(T t) {         Node&lt;T&gt; currentNode = new Node&lt;T&gt;(t);         Node&lt;T&gt; lastNode = last.getAndSet(currentNode);         if (lastNode == null) {             first.set(currentNode);         } else {             lastNode.setNext(currentNode);         }         currentNode.setNext(first.get());         size.incrementAndGet();     } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u043a\u043e\u0434\u0443, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 Node, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043d\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439. \u0415\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442\u0443 lastNode, \u0442\u043e \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435 fist \u043d\u0430 \u00ab\u043d\u043e\u0432\u044b\u0439\u00bb Node. \u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0439 \u0437\u0430 \u0440\u0430\u0437\u043c\u0435\u0440. <\/p>\n<pre><code class=\"java\"> public T next() {         if (size.get() &gt; 0) {             return current.getAndSet(current.get().next).element;         }         throw new RuntimeException(&quot;Empty collection.&quot;);     } <\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041b\u043e\u0433\u0438\u043a\u0430 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0439 get and set \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430 \u00ab\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439\u00bb. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u0442\u043e \u043c\u044b \u043a\u0438\u043d\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 RuntimeException.<\/p>\n<h4>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h4>\n<p>  \u0420\u0435\u0431\u044f\u0442\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0430. \u0412 \u043c\u044b\u0441\u043b\u044f\u0445 \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 CyclicBuffer (\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u0438 lock-free) \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 Collection. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e!)<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Full Code<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package ru.grinder.collection;  import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference;  \/**  * Created by grinder on 01.07.2014.  *\/ public class RoundRobin&lt;T&gt; {     private AtomicInteger size = new AtomicInteger(0);     private AtomicReference&lt;Node&lt;T&gt;&gt; first = new AtomicReference&lt;Node&lt;T&gt;&gt;();     private AtomicReference&lt;Node&lt;T&gt;&gt; current = first;     private AtomicReference&lt;Node&lt;T&gt;&gt; last = new AtomicReference&lt;Node&lt;T&gt;&gt;();      public RoundRobin() {     }       public boolean put(T t) {         Node&lt;T&gt; currentNode = new Node&lt;T&gt;(t);         Node&lt;T&gt; lastNode = last.getAndSet(currentNode);         if (lastNode == null) {             first.set(currentNode);         } else {             lastNode.setNext(currentNode);         }         currentNode.setNext(first.get());         size.incrementAndGet();         return true;     }      public T next() {         if (size.get() &gt; 0) {             return current.getAndSet(current.get().next).element;         }         throw new RuntimeException(&quot;Empty collection.&quot;);     }      private static class Node&lt;T&gt; {         private T element;         private Node&lt;T&gt; next;          private Node(T element) {             this.element = element;         }          public void setNext(Node&lt;T&gt; next) {             this.next = next;         }     } } <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/228647\/\"> http:\/\/habrahabr.ru\/post\/228647\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435.<\/p>\n<p>  \u0414\u0430\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u0438\u043b\u0438 \u0440\u0443\u043a\u0438. \u0414\u0430 \u0438 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u041e\u0434\u043d\u0430\u0436\u0434\u044b, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u043f\u0443\u043b\u0443. <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/h4>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c round robin, \u043a\u0430\u043a \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0446\u0438\u0442\u0430\u0442\u0430 \u0438\u0437 wiki:  <\/p>\n<blockquote><p>Round-robin (\u043e\u0442 \u0430\u043d\u0433\u043b. round-robin \u2014 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439) \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u0438\u044f \u0435\u0451 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u043c\u0443 \u0446\u0438\u043a\u043b\u0443.<\/p><\/blockquote>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u0432 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/111613\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>. \u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0439\u0442\u0438 \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043f\u0443\u0442\u0438. \u041d\u0430\u043f\u0438\u0441\u0430\u0432 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\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-228647","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228647","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=228647"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228647\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}