<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xml:base="https://www.programmez.com/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>napa.js</title>
    <link>https://www.programmez.com/</link>
    <description></description>
    <language>fr</language>
    
    <item>
  <title>Napa.js : un environnement d&#039;exécution JavaScript multithreads</title>
  <link>https://www.programmez.com/actualites/napajs-un-environnement-dexecution-javascript-multithreads-26654</link>
  <description>&lt;span class=&quot;field field--name-title field--type-string field--label-hidden&quot;&gt;Napa.js : un environnement d&amp;#039;exécution JavaScript multithreads&lt;/span&gt;
&lt;span class=&quot;field field--name-uid field--type-entity-reference field--label-hidden&quot;&gt;&lt;span&gt;fredericmazue&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;field field--name-created field--type-created field--label-hidden&quot;&gt;&lt;time datetime=&quot;2017-10-24T15:14:14+02:00&quot; title=&quot;Mardi, 24 octobre 2017 - 15:14&quot; class=&quot;datetime&quot;&gt;mar, 24 Oct 2017 - 15:14&lt;/time&gt;
&lt;/span&gt;


  &lt;div class=&quot;inline__links&quot;&gt;&lt;nav class=&quot;links inline nav links-inline&quot;&gt;&lt;span class=&quot;comment-forbidden nav-link&quot;&gt;&lt;a href=&quot;/user/login?destination=/actualites/napajs-un-environnement-dexecution-javascript-multithreads-26654%23comment-form&quot;&gt;Se connecter&lt;/a&gt; ou &lt;a href=&quot;/user/register?destination=/actualites/napajs-un-environnement-dexecution-javascript-multithreads-26654%23comment-form&quot;&gt;s&#039;inscrire&lt;/a&gt; pour publier un commentaire&lt;/span&gt;&lt;/nav&gt;
  &lt;/div&gt;

&lt;div class=&quot;btn btn-light&quot;&gt;
      &lt;a href=&quot;/actualites/outils/frameworks&quot; hreflang=&quot;fr&quot;&gt;Frameworks&lt;/a&gt;
  &lt;/div&gt;

&lt;div class=&quot;mots-cles-actualite d-flex flex-wrap gap-2&quot;&gt;
      &lt;div class=&quot;btn&quot;&gt;&lt;a href=&quot;/actualites/napajs&quot; hreflang=&quot;fr&quot;&gt;napa.js&lt;/a&gt;&lt;/div&gt;
      &lt;div class=&quot;btn&quot;&gt;&lt;a href=&quot;/actualites/multithread&quot; hreflang=&quot;fr&quot;&gt;multithread&lt;/a&gt;&lt;/div&gt;
      &lt;div class=&quot;btn&quot;&gt;&lt;a href=&quot;/mots-cl-s-actualit-s/javascript&quot; hreflang=&quot;fr&quot;&gt;JavaScript&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;

            &lt;div class=&quot;clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item&quot;&gt;&lt;p&gt;Microsoft vient d&#039;ouvrir Napa.js, une bibliothèque JavaScript maison créée à l&#039;origine pour développer des services hautement interactifs sans pénaliser la performance au sein du moteur de recherche Bing.&lt;/p&gt;
&lt;p&gt;Napa.js est un environnement d&#039;exécution JavaScript multithread construit au dessus de V8, le moteur JavaScript open source de Google. Napa.js est conçu pour permettre d&#039;exécuter du code très gourmand en calculs sans bloquer la boucle d&#039;événements. Les threads tournent sur des instances de V8 isolées les une des autres, tout en pouvant communiquer entre eux.&lt;/p&gt;
&lt;p&gt;Napa.js vient comme un module node.js, mais il peut aussi être utilisé dans des contextes sans node.js.&lt;/p&gt;
&lt;p&gt;Voici un exemple de code qui charge Napa.js puis créée une zone d&#039;exécution dans laquelle sont démarrés 4 threads.&lt;/p&gt;
&lt;p&gt;var napa = require(&#039;napajs&#039;);&lt;/p&gt;
&lt;p&gt;// Création d&#039;un zone avec 4 threads&lt;br&gt;var zone1 = napa.zone.create(&#039;zone1&#039;, { workers: 4 });&lt;/p&gt;
&lt;p&gt;// Préparation à l&#039;exécution:&lt;br&gt;// le même code de thread diffusé 4 fois dans la zone.&lt;br&gt;zone1.broadcast(&#039;console.log(&quot;hello world&quot;);&#039;);&lt;/p&gt;
&lt;p&gt;// Exécution.&lt;/p&gt;
&lt;p&gt;zone1.execute(&lt;br&gt;&amp;nbsp; &amp;nbsp; (text) =&amp;gt; text,&lt;br&gt;&amp;nbsp; &amp;nbsp; [&#039;hello napa&#039;])&lt;br&gt;&amp;nbsp; &amp;nbsp; .then((result) =&amp;gt; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.log(result.value);&lt;br&gt;&amp;nbsp; &amp;nbsp; });&lt;/p&gt;
&lt;p&gt;Napa.js est sur &lt;a href=&quot;https://github.com/Microsoft/napajs&quot;&gt;GitHub&lt;/a&gt;. Des exemples d&#039;utilisation telle que l&#039;évaluation de Pi en calcul parallélisé ou de suites des Fibonnacci sont proposés&lt;/p&gt;
&lt;/div&gt;
      &lt;section class=&quot;field field--name-field-commentaire-actu field--type-comment field--label-above comment-wrapper&quot;&gt;
      
    &lt;h2 class=&quot;title&quot;&gt;Commentaire actu&lt;/h2&gt;
    
  
  
&lt;article role=&quot;article&quot; data-comment-user-id=&quot;0&quot; id=&quot;comment-18680&quot; class=&quot;comment js-comment by-anonymous clearfix&quot;&gt;

  &lt;div class=&quot;comment__meta col-sm-3&quot;&gt;
        &lt;span class=&quot;hidden text-danger&quot; data-comment-timestamp=&quot;1508940581&quot;&gt;&lt;/span&gt;
    &lt;article class=&quot;profile&quot;&gt;
  &lt;/article&gt;

    &lt;small class=&quot;comment__author&quot;&gt;&lt;span&gt;Anonyme (non vérifié)&lt;/span&gt;&lt;/small&gt;
          &lt;/div&gt;

  &lt;div class=&quot;comment__content col-sm-9 card&quot;&gt;
    &lt;div class=&quot;card-body&quot;&gt;
              
        &lt;h3 class=&quot;card-title&quot;&gt;&lt;a href=&quot;/comment/18680#comment-18680&quot; class=&quot;permalink&quot; rel=&quot;bookmark&quot; hreflang=&quot;fr&quot;&gt;qu&amp;#039;ils se concentrent sur&lt;/a&gt;&lt;/h3&gt;
        
            
            &lt;div class=&quot;clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item&quot;&gt;&lt;p&gt;qu&#039;ils se concentrent sur leur &#039;coeur&#039; de métier. livrer un OS fonctionnel, chose qu&#039;ils n&#039;ont jamais pu faire depuis windows 3.1&lt;/p&gt;
&lt;/div&gt;
      
              &lt;nav&gt;&lt;drupal-render-placeholder callback=&quot;comment.lazy_builders:renderLinks&quot; arguments=&quot;0=18680&amp;amp;1=default&amp;amp;2=fr&amp;amp;3=&quot; token=&quot;Q76K3PlmEb3XdcvNiYbYVPNWBLpDQA1J7SppUxli1ws&quot;&gt;&lt;/drupal-render-placeholder&gt;&lt;/nav&gt;
          &lt;/div&gt;
    &lt;div class=&quot;card-body&quot;&gt;
      &lt;span class=&quot;comment__time&quot;&gt;mer, 25 Oct 2017 - 16:09&lt;/span&gt;
      &lt;span class=&quot;comment__permalink&quot;&gt;&lt;a href=&quot;/comment/18680#comment-18680&quot; hreflang=&quot;fr&quot;&gt;Permalien&lt;/a&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/article&gt;


  
&lt;/section&gt;
</description>
  <pubDate>Tue, 24 Oct 2017 13:14:14 +0000</pubDate>
    <dc:creator>fredericmazue</dc:creator>
    <guid isPermaLink="false">70706 at https://www.programmez.com</guid>
    </item>

  </channel>
</rss>
