<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Louis Dufour on Medium]]></title>
        <description><![CDATA[Stories by Louis Dufour on Medium]]></description>
        <link>https://medium.com/@louisdufour?source=rss-cc1826bed909------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*W2WvzV-wh-9MarXd.</url>
            <title>Stories by Louis Dufour on Medium</title>
            <link>https://medium.com/@louisdufour?source=rss-cc1826bed909------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:37:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@louisdufour/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Inter Process Communication]]></title>
            <link>https://medium.com/@louisdufour/inter-process-communication-3f04facb2c46?source=rss-cc1826bed909------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f04facb2c46</guid>
            <dc:creator><![CDATA[Louis Dufour]]></dc:creator>
            <pubDate>Tue, 11 Apr 2017 13:08:22 GMT</pubDate>
            <atom:updated>2017-04-12T13:41:56.145Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As an Epitech student I had to become an amateur videographer, a draw my life maker, now I have to become a journalist so be kind this is my first article !</em></p><blockquote>In <a href="https://en.wikipedia.org/wiki/Computer_science">computer science</a>, <strong>inter-process communication</strong> or <strong>interprocess communication</strong> (<strong>IPC</strong>) refers specifically to the mechanisms an <a href="https://en.wikipedia.org/wiki/Operating_system">operating system</a> provides to allow <a href="https://en.wikipedia.org/wiki/Process_(computing)">processes</a> it manages to share data. Typically, applications can use IPC, categorized as <a href="https://en.wikipedia.org/wiki/Client-server_model">clients and servers</a>, where the client requests data and the server responds to client requests. Many applications are both clients and servers, as commonly seen in <a href="https://en.wikipedia.org/wiki/Distributed_computing">distributed computing</a>. Methods for achieving IPC are divided into categories which vary based on <a href="https://en.wikipedia.org/wiki/Software_requirements">software requirements</a>, such as <a href="https://en.wikipedia.org/wiki/Algorithmic_efficiency">performance</a> and <a href="https://en.wikipedia.org/wiki/Software_design">modularity</a> requirements, and system circumstances, such as <a href="https://en.wikipedia.org/wiki/Bandwidth_(computing)">network bandwidth</a> and <a href="https://en.wikipedia.org/wiki/Latency_(engineering)">latency</a>. Cf; Wikipedia</blockquote><h3>LemIPC, our first project with the IPC.</h3><p>Lemipc is a game played on a two dimentonal board, you have to fight several team players, the last team player on the board is the winner of the game.</p><p>To kill a player, a minimum of two players from the same team (and different from the first) need to be in contact with the player to kill. It means on a square next to the one where the player you want to kill stands on. (including diagonally).</p><p>To do so we had to use new notions:</p><h4>The Shared memory:</h4><blockquote>In <a href="https://en.wikipedia.org/wiki/Computer_science">computer science</a>, <strong>shared memory</strong> is <a href="https://en.wikipedia.org/wiki/Random-access_memory">memory</a> that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies. Shared memory is an efficient means of passing data between programs. Depending on context, programs may run on a single processor or on multiple separate processors. cf. Wikipedia</blockquote><h4>Semaphores:</h4><blockquote>a <strong>semaphore</strong> is a <a href="https://en.wikipedia.org/wiki/Variable_(programming)">variable</a> or <a href="https://en.wikipedia.org/wiki/Abstract_data_type">abstract data type</a> used to control access to a common resource by multiple <a href="https://en.wikipedia.org/wiki/Process_(computing)">processes</a> in a <a href="https://en.wikipedia.org/wiki/Concurrent_computing">concurrent</a> system such as a <a href="https://en.wikipedia.org/wiki/Computer_multitasking">multiprogramming</a> operating system.</blockquote><blockquote>A trivial semaphore is a plain variable that is changed (for example, incremented or decremented, or toggled) depending on programmer-defined conditions. The variable is then used as a condition to control access to some system resource.</blockquote><h4>Few diagrams to illustrate the goal of the projet</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*G1ZbE8qr771QQvT8m-cy4A.png" /><figcaption>Yes, this is a handmade diagram…</figcaption></figure><p>On this first diagram we can see two Ai preparing for fight in the arena, red team vs yellow team. (Go Monaco !)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*JavDvm-dqh1kxPoGTRSAyw.png" /><figcaption>After few turn.</figcaption></figure><p>Here the green dot (initally yellow but it’s easier to explain with other colors) is dead because two dot from the red team are next to him.</p><h4>Our game:</h4><p>The idea was to create a shared memory containing the board when we first launch our program:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*G_2VeImkX8Fz9CYiZwkxZQ.png" /><figcaption>The board is ready, he’s waiting for two teams to start the game.</figcaption></figure><p>When the board is created we have to launch our players, the program knows with the return of the shared memory created that we already launch one time our game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Iz4rPgcj9L2NHu59cOT0NQ.png" /><figcaption>Two teams are now fighting.</figcaption></figure><p>When two teams are launched, the board is displayed on the screen, we can let the fight begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*nO_DqYYZa6JJ9XKQVCrkaQ.png" /><figcaption>On a really basic Ncurses display, the team number.</figcaption></figure><p>Finally when there is one team remaining on the board, we can tell the winner and delete our Sempahore and our shared memory.</p><h3>To conclude:</h3><p>This first IPC projet was very interesting, probably one of the most. The notion was really good.</p><p>I wish i had more time to introduce message queue and a good AI.</p><p>The problem of this project and that it’s just make no sense to fight the same AI in a game. Hope you find something for that Epitech !</p><p>Finally I want to thanks my partner, Alexandre Corvino, who gave a huge contribution to this projet. Thank you budy !</p><p>Thanks !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f04facb2c46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>