<?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>deadlock | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/deadlock/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 19 Sep 2009 18:07:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Program for Deadlock detection algorithm</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/program-for-deadlock-detection-algorithm/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/program-for-deadlock-detection-algorithm/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 19 Sep 2009 18:07:02 +0000</pubDate>
				<category><![CDATA[C Programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[deadlock]]></category>
		<category><![CDATA[algorithm]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=767</guid>

					<description><![CDATA[<p>INPUT: enter total no. of processes : 4 enter claim matrix : 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 1 0 1 enter allocation matrix : 1 0 1 1 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/program-for-deadlock-detection-algorithm/">Program for Deadlock detection algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>INPUT:<br />
enter total no. of processes : 4<br />
enter claim matrix :<br />
0 1 0 0 1<br />
0 0 1 0 1<br />
0 0 0 0 1<br />
1 0 1 0 1<br />
enter allocation matrix :<br />
1 0 1 1 0<br />
1 1 0 0 0<br />
0 0 0 1 0<br />
0 0 0 0 0<br />
enter resource vector :<br />
2 1 1 2 1<br />
enter the availability vector :<br />
0 0 0 0 1</p>
<p>OUTPUT :<br />
deadlock causing processes are : 1 2</p>
<pre lang="c">#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
void main()
{
int found,flag,l,p[4][5],tp,c[4][5],i,j,k=1,m[5],r[5],a[5],temp[5],sum=0;
clrscr();
printf("enter total no of processes");
scanf("%d",&amp;tp);
printf("enter clain matrix");
for(i=1;i&lt;=4;i++)
for(j=1;j&lt;=5;j++)
{
scanf("%d",&amp;c[i][j]);
}
printf("enter allocation matrix");
for(i=1;i&lt;=4;i++)
for(j=1;j&lt;=5;j++)
{
scanf("%d",&amp;p[i][j]);
}
printf("enter resource vector:\n");
for(i=1;i&lt;=5;i++)
{
scanf("%d",&amp;r[i]);
}
printf("enter availability vector:\n");
for(i=1;i&lt;=5;i++)
{
scanf("%d",&amp;a[i]);
temp[i]=a[i];
}
for(i=1;i&lt;=4;i++)
{
sum=0;
for(j=1;j&lt;=5;j++)
{
sum+=p[i][j];
}
if(sum==0)
{
m[k]=i;
k++;
}
}
for(i=1;i&lt;=4;i++)
{
for(l=1;l&lt;k;l++)
if(i!=m[l])
{
flag=1;
for(j=1;j&lt;=5;j++)
if(c[i][j]&gt;temp[j])
{
flag=0;
break;
}
}
if(flag==1)
{
m[k]=i;
k++;
for(j=1;j&lt;=5;j++)
temp[j]+=p[i][j];
}
}
printf("deadlock causing processes are:");
for(j=1;j&lt;=tp;j++)
{
found=0;
for(i=1;i&lt;k;i++)
{
if(j==m[i])
found=1;
}
if(found==0)
printf("%d\t",j);
}
getch();
}</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/program-for-deadlock-detection-algorithm/">Program for Deadlock detection algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/program-for-deadlock-detection-algorithm/feed/</wfw:commentRss>
			<slash:comments>28</slash:comments>
		
		
			</item>
	</channel>
</rss>
