<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; deepak garg</title>
	<atom:link href="https://www.emblogic.com/blog/author/deepak/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>C – Struct memory allocation</title>
		<link>https://www.emblogic.com/blog/04/c-struct-memory-allocation/</link>
		<comments>https://www.emblogic.com/blog/04/c-struct-memory-allocation/#comments</comments>
		<pubDate>Tue, 15 Apr 2014 18:31:07 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9811</guid>
		<description><![CDATA[Do you know how memory is allocated for structure members in C Always, contiguous(adjacent) memory locations are used to store structure members in memory. Consider below example to understand how memory is allocated for structures. Example program for memory allocation &#8230; <a href="https://www.emblogic.com/blog/04/c-struct-memory-allocation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Do you know how memory is allocated for structure members in C</p>
<p><strong></strong>Always, contiguous(adjacent) memory locations are used to store structure members in memory. Consider below example to understand how memory is allocated for structures.</p>
<h4><strong>Example program for memory allocation in C structure</strong></h4>
<div>
<div><textarea readonly="readonly">#include &lt;stdio.h&gt;<br />
#include &lt;string.h&gt;</p>
<p>struct student<br />
{<br />
       int id1;<br />
       int id2;<br />
       char a;<br />
       char b;<br />
       float percentage;<br />
};</p>
<p>int main()<br />
{<br />
    int i;<br />
    struct student record1 = {1, 2, &#8216;A&#8217;, &#8216;B&#8217;, 90.5};</p>
<p>    printf(&#8220;size of structure in bytes : %d\n&#8221;,<br />
                           sizeof(record1));</p>
<p>    printf(&#8220;\nAddress of id1        = %u&#8221;, &amp;record1.id1 );<br />
    printf(&#8220;\nAddress of id2        = %u&#8221;, &amp;record1.id2 );<br />
    printf(&#8220;\nAddress of a          = %u&#8221;, &amp;record1.a );<br />
    printf(&#8220;\nAddress of b          = %u&#8221;, &amp;record1.b );<br />
    printf(&#8220;\nAddress of percentage = %u&#8221;,&amp;record1.pe </textarea></div>
<div>
<table width="612">
<tbody>
<tr>
<td></td>
<td>
<div>
<div>#include &lt;stdio.h&gt;</div>
<div>#include &lt;string.h&gt;</div>
<div>struct student</div>
<div>{</div>
<div>       int id1;</div>
<div>       int id2;</div>
<div>       char a;</div>
<div>       char b;</div>
<div>       float percentage;</div>
<div>};</div>
<div></div>
<div>int main()</div>
<div>{</div>
<div>    int i;</div>
<div>    struct student record1 = {1, 2, &#8216;A&#8217;, &#8216;B&#8217;, 90.5};</div>
<div></div>
<div>    printf(&#8220;size of structure in bytes : %d\n&#8221;,</div>
<div>                           sizeof(record1));</div>
<div></div>
<div>    printf(&#8220;\nAddress of id1        = %u&#8221;, &amp;record1.id1 );</div>
<div>    printf(&#8220;\nAddress of id2        = %u&#8221;, &amp;record1.id2 );</div>
<div>    printf(&#8220;\nAddress of a          = %u&#8221;, &amp;record1.a );</div>
<div>    printf(&#8220;\nAddress of b          = %u&#8221;, &amp;record1.b );</div>
<div>    printf(&#8220;\nAddress of percentage = %u&#8221;,&amp;record1.percentage);</div>
<div></div>
<div>    return 0;</div>
<div>}</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h4> <strong>Output:</strong></h4>
<table border="1" cellspacing="1" cellpadding="1" align="center">
<tbody>
<tr>
<td colspan="3">size of structure in bytes : 16Address of id1 = 675376768<br />
Address of id2 = 675376772<br />
Address of a = 675376776<br />
Address of b = 675376777<br />
Address of percentage = 675376780</td>
</tr>
</tbody>
</table>
<p><strong>           </strong>There are 5 members declared for structure in above program. In 32 bit compiler, 4 bytes of memory is occupied by int datatype. 1 byte of memory is occupied by char datatype and 4 bytes of memory is occupied by float datatype.</p>
<p>Please refer below table to know from where to where memory is allocated for each datatype in contiguous (adjacent) location in memory.</p>
<div>
<table>
<tbody>
<tr>
<td rowspan="2"><strong>Datatype</strong></td>
<td colspan="3"><strong>Memory allocation in C (32 bit compiler)</strong></td>
</tr>
<tr>
<td><strong>From Address</strong></td>
<td><strong>To Address</strong></td>
<td><strong>Total bytes         </strong></td>
</tr>
<tr>
<td>int id1</td>
<td>675376768</td>
<td>675376771</td>
<td>4</td>
</tr>
<tr>
<td><strong>int id2</strong></td>
<td><strong>675376772</strong></td>
<td><strong>675376775</strong></td>
<td><strong>4</strong></td>
</tr>
<tr>
<td>char a</td>
<td colspan="2">675376776</td>
<td>1</td>
</tr>
<tr>
<td><strong>char b</strong></td>
<td colspan="2"><strong>675376777</strong></td>
<td><strong>1</strong></td>
</tr>
<tr>
<td colspan="3"><strong>Addresses 675376778 and 675376779 are left empty</strong><br />
(Do you know why? Please see Structure padding topic below)</td>
<td><strong>2</strong></td>
</tr>
<tr>
<td>float percentage</td>
<td>675376780</td>
<td>675376783</td>
<td>4</td>
</tr>
</tbody>
</table>
</div>
<p><strong>           </strong>The pictorial representation of above structure memory allocation is given below. This diagram will help you to understand the memory allocation concept in C very easily.</p>
<p><img src="http://fresh2refresh.com/wp-content/uploads/2013/07/structure-members-are-stored-in-memory.png" alt="C structure members storage in memory" width="461" height="201" /></p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/04/c-struct-memory-allocation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic memory allocation</title>
		<link>https://www.emblogic.com/blog/03/dynamic-memory-allocation-3/</link>
		<comments>https://www.emblogic.com/blog/03/dynamic-memory-allocation-3/#comments</comments>
		<pubDate>Mon, 03 Mar 2014 07:18:53 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8804</guid>
		<description><![CDATA[DETAILS The task of fulfilling an allocation request consists of locating a block of unused memory of sufficient size. Memory requests are satisfied by allocating portions from a large pool of memory called the heap. At any given time, some &#8230; <a href="https://www.emblogic.com/blog/03/dynamic-memory-allocation-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>DETAILS</p>
<p>The task of fulfilling an allocation request consists of locating a block of unused memory of sufficient size. Memory requests are satisfied by allocating portions from a large pool of memory called <em>the heap</em>. At any given time, some parts of the heap are in use, while some are &#8220;free&#8221; (unused) and thus available for future allocations. Several issues complicate implementation, such as external fragmentation, which arises when there are many small gaps between allocated memory blocks, which invalidates their use for an allocation request. The allocator&#8217;s metadata can also inflate the size of (individually) small allocations. This is managed often by chunking. The memory management system must track outstanding allocations to ensure that they do not overlap and that no memory is ever &#8220;lost&#8221; as a memory leak.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/dynamic-memory-allocation-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IEEE 1284 &#8211; PARELLEL PORT</title>
		<link>https://www.emblogic.com/blog/02/ieee-1284-parellel-port/</link>
		<comments>https://www.emblogic.com/blog/02/ieee-1284-parellel-port/#comments</comments>
		<pubDate>Sat, 22 Feb 2014 06:41:49 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8464</guid>
		<description><![CDATA[The IEEE 1284 standard allows for faster throughput and bidirectional data flow with a theoretical maximum throughput of 4 megabytes per second; actual throughput is around 2 megabytes/second, depending on hardware. In the printer venue, this allows for faster printing &#8230; <a href="https://www.emblogic.com/blog/02/ieee-1284-parellel-port/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<ol>
<li>The IEEE 1284 standard allows for faster throughput and bidirectional data flow with a theoretical maximum throughput of 4 megabytes per second; actual throughput is around 2 megabytes/second, depending on hardware. In the printer venue, this allows for faster printing and back-channel status and management. Since the new standard allowed the peripheral to send large amounts of data back to the host, devices that had previously used SCSI interfaces could be produced at a much lower cost. This included scanners, tape drives, hard disks, computer networks connected directly via parallel interface, network adapters and other devices. No longer was the consumer required to purchase an expensive SCSI card—they could simply use their built-in parallel interface. These low-cost devices provided a platform to leapfrog the faster USB interface into its present popularity, displacing the parallel devices. However, the parallel interface remains highly popular in the printer industry, with displacement by USB only in consumer models.</li>
</ol>
<p>IEEE 1284 can operate in five modes:</p>
<p>1.   Compatibility Mode, also known as Centronics standard or SPP, is a uni-directional implementation with only a few differences from the original Centronics design. This mode is almost exclusively used for printers. The only signals that the printer can send back to the host are some fixed-meaning status lines that signal common error conditions, such as the printer running out of paper.</p>
<p>2.  Nibble Mode is an interface that allows the device to transmit data four bits (a nibble) at a time, (re)using four of the status lines of Compatibility Mode for data. This is the Bi-tronics mode introduced by HP and is generally used for enhanced printer status. Although never officially supported with these, Nibble Mode works with most of the pre-IEEE-1284 Centronics interfaces as well.</p>
<p>3. Byte Mode, also known as &#8220;Bi-Directional&#8221; (although all modes except Compatibility Mode are in fact bi-directional), is a half-duplex mode that allows the device to transmit eight bits at a time using the same data lines that are used for the other direction. This mode is supported on a minority of pre-IEEE-1284 interfaces as well, such as those built into the IBM PS/2 computers; because of this, it is sometimes unofficially called the PS/2 mode.</p>
<p>4.   Enhanced Parallel Port (EPP) is a half-duplex bi-directional interface designed to allow devices like printers, scanners, or storage devices to transmit large amounts of data while quickly being able to switch channel direction. EPP can provide up to 2 MByte/s bandwidth, approximately 15 times the speed achieved with normal parallel-port communication with far less CPU overhead.[1]</p>
<p>5.Extended Capability Port (ECP) is a half-duplex bi-directional interface similar to EPP, except that PC implementations use direct memory access (usually ISA DMA on channel 3) to provide even faster data transfer than EPP by having the ISA DMA hardware and the parallel port interface hardware handle the work of transferring the data instead of letting the CPU do this work. Many devices that interface using this mode support RLE compression. ECP can provide up to 2.5 MByte/s of bandwidth, which is the natural limit of 8-bit ISA DMA.[2] An ECP interface on a PC can improve transfers to pre-IEEE-1284 printers as well, by reducing the CPU load during the transfer ; however, the transfer in that case is unidirectional.</p>
<p>Most recent computers that include a parallel port can operate the port in ECP or EPP mode, or both simultaneously.</p>
<p>IEEE-1284 requires that bi-directional device communication is always initiated in Nibble Mode. If the host receives no reply in this mode, it will assume that the device is a legacy printer, and enter Compatibility Mode. Oth</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/ieee-1284-parellel-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>INTODUCTION TO CHARACTER DEVICE DRIVER</title>
		<link>https://www.emblogic.com/blog/01/intoduction-to-character-device-driver/</link>
		<comments>https://www.emblogic.com/blog/01/intoduction-to-character-device-driver/#comments</comments>
		<pubDate>Fri, 10 Jan 2014 07:48:10 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8072</guid>
		<description><![CDATA[Character special files or character devices relate to devices through which the system transmits data one character at a time by, for example, getchar. These device nodes often serve for stream communication with devices such as mice, keyboards, virtual terminals, &#8230; <a href="https://www.emblogic.com/blog/01/intoduction-to-character-device-driver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>Character special files</em> or <em>character devices</em> relate to devices through which the system transmits data one character at a time by, for example, <strong>getchar</strong>. These device nodes often serve for stream communication with devices such as mice, keyboards, virtual terminals, and serial modems, and usually do not support random access to data.</p>
<p>In most implementations, character devices use unbuffered input and output routines. The system reads each character from the device immediately or writes each character to the device immediately.</p>
<p>There are two major ways for a kernel module to talk to processes. One is through device files (like the files in the <tt>/dev</tt> directory), the other is to use the proc file system. Since one of the major reasons to write something in the kernel is to support some kind of hardware device, we&#8217;ll begin with device files.</p>
<p>The original purpose of device files is to allow processes to communicate with device drivers in the kernel, and through them with physical devices (modems, terminals, etc.). The way this is implemented is the following.</p>
<p>Each device driver, which is responsible for some type of hardware, is assigned its own major number. The list of drivers and their major numbers is available in <tt>/proc/devices</tt>. Each physical device managed by a device driver is assigned a minor number. The <tt>/dev</tt> directory is supposed to include a special file, called a device file, for each of those devices, whether or not it&#8217;s really installed on the system.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/intoduction-to-character-device-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>implementation &amp; demostration of character device driver</title>
		<link>https://www.emblogic.com/blog/01/implementation-demostration-of-character-device-driver/</link>
		<comments>https://www.emblogic.com/blog/01/implementation-demostration-of-character-device-driver/#comments</comments>
		<pubDate>Mon, 06 Jan 2014 11:12:12 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8032</guid>
		<description><![CDATA[Implemented the following: 1.Register the driver by using the new mechanism, allocate the memory , initialise and add the cdev to device table. head    1.2; access; symbols; locks root:1.2; strict; comment    @ * @; 1.2 date    2014.01.06.11.00.57;    author root;    state &#8230; <a href="https://www.emblogic.com/blog/01/implementation-demostration-of-character-device-driver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Implemented the following:</p>
<p>1.Register the driver by using the new mechanism, allocate the memory , initialise and add the cdev to device table.</p>
<p>head    1.2;<br />
access;<br />
symbols;<br />
locks<br />
root:1.2; strict;<br />
comment    @ * @;</p>
<p>1.2<br />
date    2014.01.06.11.00.57;    author root;    state Exp;<br />
branches;<br />
next    1.1;</p>
<p>1.1<br />
date    2014.01.06.10.57.33;    author root;    state Exp;<br />
branches;<br />
next    ;</p>
<p>desc<br />
@this is source code for register device by the new mechnism and allocate the the memory by using kmalloc and add cdev to the device table.<br />
@</p>
<p>1.2<br />
log<br />
@removed the  errors.<br />
@</p>
<p>2.After registration, allocation, and adding the cdev to device table, delete the cdev form device table, deallocate the memory and unregister the driver.</p>
<p>head    1.2;<br />
access;<br />
symbols;<br />
locks<br />
root:1.2; strict;<br />
comment    @ * @;</p>
<p>1.2<br />
date    2014.01.06.11.03.44;    author root;    state Exp;<br />
branches;<br />
next    1.1;</p>
<p>1.1<br />
date    2014.01.06.10.58.52;    author root;    state Exp;<br />
branches;<br />
next    ;</p>
<p>desc<br />
@this is souce code for cleanup function in which unregister the driver by new mechnism and deallocate the mem.&amp; cdev remove it in cleanup function.<br />
@</p>
<p>1.2<br />
log<br />
@removed the errors.<br />
@</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/implementation-demostration-of-character-device-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>character driver register  implementation</title>
		<link>https://www.emblogic.com/blog/01/character-driver-register-implementation/</link>
		<comments>https://www.emblogic.com/blog/01/character-driver-register-implementation/#comments</comments>
		<pubDate>Sat, 04 Jan 2014 11:30:22 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8006</guid>
		<description><![CDATA[log file of init function head    1.1; access; symbols; locks root:1.1; strict; comment    @ * @; 1.1 date    2014.01.04.11.18.09;    author root;    state Exp; branches; next    ; desc @this is the source code of init function for initialization in device driver &#8230; <a href="https://www.emblogic.com/blog/01/character-driver-register-implementation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>log file of init function</p>
<p>head    1.1;<br />
access;<br />
symbols;<br />
locks<br />
root:1.1; strict;<br />
comment    @ * @;</p>
<p>1.1<br />
date    2014.01.04.11.18.09;    author root;    state Exp;<br />
branches;<br />
next    ;</p>
<p>desc<br />
@this is the source code of init function for initialization in device driver<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@</p>
<p>log file of exit function</p>
<p>head    1.1;<br />
access;<br />
symbols;<br />
locks<br />
root:1.1; strict;<br />
comment    @ * @;</p>
<p>1.1<br />
date    2014.01.04.11.18.43;    author root;    state Exp;<br />
branches;<br />
next    ;</p>
<p>desc<br />
@this is the source of exit function for clean up the device driver<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/01/character-driver-register-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socket implementation</title>
		<link>https://www.emblogic.com/blog/12/socket-implementation-2/</link>
		<comments>https://www.emblogic.com/blog/12/socket-implementation-2/#comments</comments>
		<pubDate>Mon, 30 Dec 2013 19:30:49 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7971</guid>
		<description><![CDATA[head  1.1; access; symbols; locks root:1.1; strict; comment     @ * @; 1.1 date  2013.12.30.05.37.11;    author root;      state Exp; branches; next  ; desc @this is server implemented by socket and create usrname &#38; password for server @ 1.1 log @Initial revision &#8230; <a href="https://www.emblogic.com/blog/12/socket-implementation-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head  1.1;<br />
access;<br />
symbols;<br />
locks<br />
root:1.1; strict;<br />
comment     @ * @;</p>
<p>1.1<br />
date  2013.12.30.05.37.11;    author root;      state Exp;<br />
branches;<br />
next  ;</p>
<p>desc<br />
@this is server implemented by socket and create usrname &amp; password for server<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text</p>
<p>head  1.1;<br />
access;<br />
symbols;<br />
locks<br />
root:1.1; strict;<br />
comment     @ * @;</p>
<p>1.1<br />
date  2013.12.30.05.36.51;    author root;      state Exp;<br />
branches;<br />
next  ;</p>
<p>desc<br />
@this is client implemented by using socket<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/socket-implementation-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AN OVERVIEW OF PROCESS COMMUNICATION IN LINUX</title>
		<link>https://www.emblogic.com/blog/12/an-overview-of-process-communication-in-linux/</link>
		<comments>https://www.emblogic.com/blog/12/an-overview-of-process-communication-in-linux/#comments</comments>
		<pubDate>Mon, 30 Dec 2013 07:45:43 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7914</guid>
		<description><![CDATA[An Overview of Process Communication in Linux First of all, let&#8217;s understand the actual meaning of: IPC. IPC is an abbreviation that stands for Inter-process Communication. It denotes a set of system calls that allows a User Mode process to: &#8230; <a href="https://www.emblogic.com/blog/12/an-overview-of-process-communication-in-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>An Overview of Process Communication in Linux</h2>
<p>First of all, let&#8217;s understand the actual meaning of: IPC. IPC is an abbreviation that stands for Inter-process Communication. It denotes a set of system calls that allows a User Mode process to:</p>
<ol>
<li>Synchronize itself with other processes by means of &#8216;Semaphores&#8217;.</li>
<li>Send messages to other processes or receive messages from them.</li>
<li>Share a memory area with other processes.</li>
</ol>
<p>IPC was introduced in a development UNIX variant called &#8220;Columbus Unix&#8221; and later adopted by AT&amp;T&#8217;s System III. It is now commonly found in most UNIX systems,  and provides three methods of communication: message queues, semaphores, and shared segments. Like BSD <code>mmap</code>, System V IPC uses files to identify shared segments. Unlike BSD, System V uses these files only for naming. Their contents have nothing to do with the initialization of the shared segment. IPC data structures are created dynamically when a process requests an IPC Resource, i.e. a semaphore, a message queue, or a shared memory segment. All of these IPC Resources would be discussed in detail later on. Before we dive deep into the subject matter, there are a few things that I would like to explain at the very beginning. They are as follows:</p>
<ol>
<li>The mechanism in which User Mode processes synchronize themselves and exchange data is referred to as &#8220;Inter-process Communication (IPC)&#8221; in UNIX Systems (that includes Linux too). But in what way exactly do terms like: Semaphores, Shared Memory and Message Queues relate to IPC? All readers must note that Semaphores, Shared Memory and Message Queues do relate to IPC in a very special way, since Semaphores, Shared Memory and Message Queues are &#8220;Inter-process Communication Resources&#8221; or &#8220;Inter-process Communication Facilities&#8221;, and different in the way they represent IPC from &#8220;Inter-process Communication Mechanisms&#8221; like Pipes and FIFOs. Semaphores, Shared Memory and Message Queues are <strong>System V (AT&amp;T System V.2 release of UNIX) IPC</strong> <strong>facilities</strong>, and they represent wrapper functions that have been developed and inserted in suitable libraries to harness the energy and beauty of IPC mechanisms. More on this later.</li>
<li>Data sharing among processes can be obtained by storing data in temporary files protected by locks. But this mechanism is never implemented as it proves costly since it requires accesses to the disk filesystem. For that reason, all UNIX Kernels include a set of system calls that supports process communications without interacting with the filesystem.</li>
</ol>
<p>Application programmers have a variety of needs that call for different communication mechanisms. Some of the basic mechanisms that UNIX systems, GNU/Linux is particular has to offer are:</p>
<ol>
<li><strong>Pipes and FIFOs</strong>: Mainly used for implementing producer/consumer interactions among processes. Some processes will fill the pipe with data while others will extract from it.</li>
<li><strong>Semaphores</strong>: Here we refer to (NOT the POSIX Realtime Extension Semaphores applied to Linux Kernel Threads), but System V semaphores which apply to User Mode processes. Used for locking critical sections of code.</li>
<li><strong>Message Queues</strong>: To set up a message queue between processes is a way to exchange short blocks (called messages) between two processes in an asynchronous way.</li>
<li><strong>Shared Memory</strong>: A mechanism (specifically a resource) applied when processes need to share large amounts of data in an efficient way.</li>
</ol>
<p>Another commonly used data communication mechanism in networks, &#8220;Sockets&#8221; will NOT be discussed here since it requires a long discussion of networking. In this article, we will explore all the above-mentioned IPC mechanisms and System V IPC facilities at our disposal.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/an-overview-of-process-communication-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socket</title>
		<link>https://www.emblogic.com/blog/12/socket-5/</link>
		<comments>https://www.emblogic.com/blog/12/socket-5/#comments</comments>
		<pubDate>Sun, 29 Dec 2013 08:46:17 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7879</guid>
		<description><![CDATA[head    ; access; symbols; locks; strict; comment @ * @; desc @this is the client implemented with socket. @]]></description>
				<content:encoded><![CDATA[<p><strong>head    ;</strong><br />
<strong>access;</strong><br />
<strong>symbols;</strong><br />
<strong>locks; strict;</strong><br />
<strong>comment @ * @;</strong></p>
<p><strong>desc</strong><br />
<strong>@this is the client implemented with socket.</strong><br />
<strong>@</strong></p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/socket-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socket</title>
		<link>https://www.emblogic.com/blog/12/socket-4/</link>
		<comments>https://www.emblogic.com/blog/12/socket-4/#comments</comments>
		<pubDate>Sun, 29 Dec 2013 08:43:32 +0000</pubDate>
		<dc:creator><![CDATA[deepak garg]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7875</guid>
		<description><![CDATA[head    ; access; symbols; locks; strict; comment @ * @; desc @this is code of server which is implemented with the use of socket. @ ~ ~]]></description>
				<content:encoded><![CDATA[<p>head    ;<br />
access;<br />
symbols;<br />
locks; strict;<br />
comment @ * @;</p>
<p>desc<br />
@this is code of server which is implemented with the use of socket.<br />
@<br />
~<br />
~</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/socket-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
