<?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; Mannu Kaushik</title>
	<atom:link href="https://www.emblogic.com/blog/author/mannukaushikece/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>IPC USING FIFOS AND SEMAPHORES</title>
		<link>https://www.emblogic.com/blog/08/ipc-using-fifos-and-semaphores-2/</link>
		<comments>https://www.emblogic.com/blog/08/ipc-using-fifos-and-semaphores-2/#comments</comments>
		<pubDate>Tue, 19 Aug 2014 04:33:17 +0000</pubDate>
		<dc:creator><![CDATA[Mannu Kaushik]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11391</guid>
		<description><![CDATA[****************************************************************************************** RCS file: server.c,v Working file: server.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: Made a server file which takes request from client and forwards it to processing client Then it takes &#8230; <a href="https://www.emblogic.com/blog/08/ipc-using-fifos-and-semaphores-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>******************************************************************************************</p>
<p>RCS file: server.c,v<br />
Working file: server.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
Made a server file which takes request from client and forwards it to processing client<br />
Then it takes result from processing client and gives the result back to the requesting client<br />
the requesting client is given a pid to which server returns his answer.<br />
=============================================================================</p>
<p>RCS file: script,v<br />
Working file: script<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
this is the script file which is made to execute all the files at once.<br />
total 5 fifos are used and one semaphore is used in the server.<br />
=============================================================================</p>
<p>RCS file: client.c,v<br />
Working file: client.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
The client sends the request using command line arguments<br />
and at the finishing end it reads the result back from the server.<br />
=============================================================================</p>
<p>RCS file: add.c,v<br />
Working file: add.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
processing client adds the two files after reading values from server<br />
and writes back the result to the server<br />
=============================================================================</p>
<p>RCS file: sub.c,v<br />
Working file: sub.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
thats another processing client<br />
it subtracts the two values<br />
=============================================================================</p>
<p>RCS file: mul.c,v<br />
Working file: mul.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
its function is also same as other processing clients but it multiplies them.<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/08/ipc-using-fifos-and-semaphores-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPC(Inter Process Communication) using pipes</title>
		<link>https://www.emblogic.com/blog/08/ipcinter-process-communication-using-pipes/</link>
		<comments>https://www.emblogic.com/blog/08/ipcinter-process-communication-using-pipes/#comments</comments>
		<pubDate>Wed, 06 Aug 2014 18:34:27 +0000</pubDate>
		<dc:creator><![CDATA[Mannu Kaushik]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11366</guid>
		<description><![CDATA[RCS file: server.c,v Working file: server.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: made the server to perform three operations but can create file descriptors upto 100 ============================================================================= RCS file: add.c,v Working &#8230; <a href="https://www.emblogic.com/blog/08/ipcinter-process-communication-using-pipes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: server.c,v<br />
Working file: server.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
made the server to perform three operations<br />
but can create file descriptors upto 100<br />
=============================================================================</p>
<p>RCS file: add.c,v<br />
Working file: add.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
made the file for adding<br />
will be exexuted from server through the pipe.<br />
=============================================================================</p>
<p>RCS file: sub.c,v<br />
Working file: sub.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
made the file for subtracting<br />
will be executed from server through the pipe<br />
=============================================================================</p>
<p>RCS file: mul.c,v<br />
Working file: mul.c<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
similar function except this will multiply.<br />
=============================================================================</p>
<p>RCS file: header.h,v<br />
Working file: header.h<br />
head:<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 0<br />
description:<br />
made the header file<br />
included 5 header files<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/08/ipcinter-process-communication-using-pipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implemented Circular Queues with linked lists</title>
		<link>https://www.emblogic.com/blog/07/implemented-circular-queues-with-linked-lists/</link>
		<comments>https://www.emblogic.com/blog/07/implemented-circular-queues-with-linked-lists/#comments</comments>
		<pubDate>Fri, 25 Jul 2014 15:38:55 +0000</pubDate>
		<dc:creator><![CDATA[Mannu Kaushik]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11307</guid>
		<description><![CDATA[#include&#60;stdio.h&#62; #include&#60;stdlib.h&#62; int flag=0; struct node { int val; struct node*next; }*front=NULL,*rear=NULL,*start=NULL; int count=0; int get_choice(int *); int create_node(); int enqueue(); int dequeue(); int display(); int main() { int choice=1; while(choice) { printf(&#8220;\n+++++++++MENU+++++++++\n&#8221;); printf(&#8220;1.CREATE NODE\n&#8221;); printf(&#8220;2.INSERT\n&#8221;); printf(&#8220;3.DELETE\n&#8221;); printf(&#8220;4.DISPLAY\n&#8221;); printf(&#8220;0.EXIT\n&#8221;); printf(&#8220;enter &#8230; <a href="https://www.emblogic.com/blog/07/implemented-circular-queues-with-linked-lists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
int flag=0;<br />
struct node<br />
{<br />
int val;<br />
struct node*next;<br />
}*front=NULL,*rear=NULL,*start=NULL;<br />
int count=0;<br />
int get_choice(int *);<br />
int create_node();<br />
int enqueue();<br />
int dequeue();<br />
int display();<br />
int main()<br />
{<br />
int choice=1;<br />
while(choice)<br />
{</p>
<p>printf(&#8220;\n+++++++++MENU+++++++++\n&#8221;);<br />
printf(&#8220;1.CREATE NODE\n&#8221;);<br />
printf(&#8220;2.INSERT\n&#8221;);<br />
printf(&#8220;3.DELETE\n&#8221;);<br />
printf(&#8220;4.DISPLAY\n&#8221;);<br />
printf(&#8220;0.EXIT\n&#8221;);<br />
printf(&#8220;enter your choice&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;choice);<br />
get_choice(&amp;choice);<br />
}}<br />
int get_choice(int *choice)<br />
{<br />
switch(*choice)<br />
{<br />
case 1:create_node();break;<br />
case 2:enqueue();break;<br />
case 3:dequeue();break;<br />
case 4:display();break;<br />
case 0:exit(0);<br />
}}<br />
int create_node()<br />
{<br />
if(flag==0)<br />
{<br />
printf(&#8220;queue created\n&#8221;);<br />
flag++;<br />
}<br />
else if(flag&gt;=1)<br />
{<br />
printf(&#8220;queue already created\n&#8221;);<br />
}</p>
<p>}<br />
int enqueue()<br />
{<br />
struct node*temp;<br />
temp=(struct node*)malloc(10*sizeof(struct node*));</p>
<p>if(flag==0)<br />
{<br />
printf(&#8220;create a queue first\n&#8221;);<br />
return 0;<br />
}<br />
else if(flag==1)<br />
{<br />
printf(&#8220;enter the values\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(temp-&gt;val));<br />
temp-&gt;next=NULL;<br />
start=rear=temp;<br />
}<br />
if(flag&gt;1)<br />
{<br />
printf(&#8220;enter the values!\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(temp-&gt;val));<br />
temp-&gt;next=NULL;<br />
rear-&gt;next=temp;<br />
rear=rear-&gt;next;</p>
<p>}<br />
if(flag&gt;5)<br />
{</p>
<p>printf(&#8220;queue is full\n&#8221;);<br />
return 0;<br />
}<br />
flag++;<br />
display();<br />
}<br />
int dequeue()<br />
{<br />
struct node*temp,*temp1;<br />
{<br />
if(flag==0)<br />
printf(&#8220;create a queue first\n&#8221;);</p>
<p>else if(flag==1)<br />
{<br />
printf(&#8220;queue is empty\n`&#8221;);</p>
<p>}<br />
if(!front )<br />
{<br />
temp=start;<br />
front=start-&gt;next;<br />
printf(&#8220;%d is popped\n&#8221;,temp-&gt;val);<br />
free(temp);</p>
<p>}<br />
else if(front)<br />
{<br />
temp=front;<br />
front=front-&gt;next;<br />
printf(&#8220;%d is popped\n&#8221;,temp-&gt;val);<br />
free(temp);<br />
printf(&#8220;\n%d&#8221;,flag);<br />
flag&#8211;;<br />
}</p>
<p>display();</p>
<p>}}<br />
int display()<br />
{<br />
struct node*temp;</p>
<p>if(flag==0)<br />
{<br />
printf(&#8220;nothing to display\n&#8221;);<br />
}<br />
else if(flag&gt;=1)<br />
{<br />
if(!front)<br />
{<br />
temp=start;<br />
}<br />
else<br />
{<br />
temp=front;<br />
}<br />
while(temp)<br />
{<br />
printf(&#8221; %d&#8211;&#8221;,temp-&gt;val);<br />
temp = temp-&gt;next;<br />
}<br />
}}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/07/implemented-circular-queues-with-linked-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implemented Queues with  linked lists</title>
		<link>https://www.emblogic.com/blog/07/implemented-queues-with-linked-lists/</link>
		<comments>https://www.emblogic.com/blog/07/implemented-queues-with-linked-lists/#comments</comments>
		<pubDate>Fri, 25 Jul 2014 15:37:43 +0000</pubDate>
		<dc:creator><![CDATA[Mannu Kaushik]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11305</guid>
		<description><![CDATA[#include&#60;stdio.h&#62; #include&#60;stdlib.h&#62; struct node { int val; struct node*next; }*front,*rear,*start=NULL; int flag=0; int get_choice(int*); int create_node(); int enqueue(); int dequeue(); int display(); int main() { int choice=1; while (choice) { printf(&#8220;+++++++++++++++++++MENU++++++++++++++++++++++\n                &#8220;); printf(&#8221;                1.CREATE NODE                \n                &#8220;); printf(&#8221;                2.ENQUEUE                    \n                &#8230; <a href="https://www.emblogic.com/blog/07/implemented-queues-with-linked-lists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
struct node<br />
{<br />
int val;<br />
struct node*next;<br />
}*front,*rear,*start=NULL;<br />
int flag=0;<br />
int get_choice(int*);<br />
int create_node();<br />
int enqueue();<br />
int dequeue();<br />
int display();<br />
int main()<br />
{<br />
int choice=1;</p>
<p>while (choice)<br />
{<br />
printf(&#8220;+++++++++++++++++++MENU++++++++++++++++++++++\n                &#8220;);<br />
printf(&#8221;                1.CREATE NODE                \n                &#8220;);<br />
printf(&#8221;                2.ENQUEUE                    \n                &#8220;);<br />
printf(&#8221;                3.DEQUEUE                    \n                &#8220;);<br />
printf(&#8221;                4.DISPLAY                    \n                &#8220;);<br />
printf(&#8221;                0.EXIT                       \n                &#8220;);<br />
printf(&#8220;enter your choice\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;choice);<br />
get_choice(&amp;choice);<br />
}}<br />
int get_choice(int*choice)<br />
{<br />
switch(*choice)<br />
{<br />
case 1:create_node();break;<br />
case 2:enqueue();break;<br />
case 3:dequeue();break;<br />
case 4:display();break;<br />
case 0:exit(0);break;<br />
}}<br />
int create_node()<br />
{<br />
if(flag==0)<br />
{<br />
front=NULL;<br />
rear=NULL;<br />
printf(&#8220;queue created successfully&#8221;);<br />
flag++;<br />
}<br />
else if(flag==1)<br />
{<br />
printf(&#8220;queue already created&#8221;);<br />
}<br />
}<br />
int enqueue()<br />
{<br />
struct node*temp;<br />
int i;<br />
temp=(struct node*)malloc(sizeof(struct node));</p>
<p>if(flag==0)<br />
{<br />
printf(&#8220;queue not created\n&#8221;);<br />
return 0;<br />
}<br />
else if(flag&gt;5)<br />
{<br />
printf(&#8220;queue is full\n&#8221;);<br />
return 0;<br />
}<br />
if(flag == 1)<br />
{</p>
<p>printf(&#8220;enter the value to insert\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(temp-&gt;val));<br />
temp-&gt;next=NULL;<br />
start=rear=temp;<br />
flag++;<br />
}<br />
else if(flag&gt;1 &amp;&amp; flag!=1)<br />
{<br />
printf(&#8220;enter value&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(temp-&gt;val));<br />
temp-&gt;next=NULL;<br />
rear-&gt;next=temp;<br />
rear=rear-&gt;next;<br />
flag++;<br />
}</p>
<p>printf(&#8220;element inserted %d\n&#8221;,flag);</p>
<p>display();</p>
<p>}<br />
int dequeue()<br />
{<br />
struct node*temp;<br />
i:    if(flag == 0 )<br />
{<br />
printf(&#8220;queue empty\n&#8221;);<br />
return 0;<br />
}<br />
if(front == rear)<br />
{<br />
goto o;<br />
}<br />
if(!front)<br />
{<br />
front=start-&gt;next;<br />
printf(&#8220;%d is dequed\n&#8221;,start-&gt;val);</p>
<p>}<br />
else if(front)<br />
{<br />
temp=front;<br />
front=front-&gt;next;<br />
printf(&#8220;%d is dequed\n&#8221;,temp-&gt;val);<br />
}<br />
else if(front == rear &amp;&amp; front-&gt;next==NULL)<br />
{</p>
<p>o:    printf(&#8220;%d is dequed\n&#8221;,front-&gt;val);<br />
printf(&#8220;queue empty\n&#8221;);<br />
front-&gt;next=NULL;<br />
rear=front=start-&gt;next=NULL;<br />
flag =0;<br />
goto i;<br />
}</p>
<p>display();</p>
<p>}<br />
int display()<br />
{<br />
struct node*temp;<br />
if(flag==0)<br />
{    printf(&#8220;create a queue first\n&#8221;);<br />
return 0;<br />
}<br />
if(!front)<br />
temp = start;<br />
else<br />
temp = front;<br />
while(temp!=NULL)<br />
{<br />
printf(&#8220;&lt;-%d&#8221;,(temp)-&gt;val);<br />
temp=temp-&gt;next;</p>
<p>}<br />
printf(&#8220;\n&#8221;);</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/07/implemented-queues-with-linked-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
