473,394 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Please Help Me To Write Code For Banker's Algoritm In Visual Basic 6.0

1
Please If any one of you know how to write code which will test the safe sequency i.e code that express Banker's algorithm
The pseudocode is as folows


 Step1: Let Work and Finish be vectors of length m and n, respectively.
Initialize:
Work := Available
Finish[i] := false for i = 1, 2, ..., n.
 Step2: Find an i such that both: (a unfinished process Pi whose future need for resources can be accommodated)
(a) Finish[i] = false
(b) Needi <= Work
If no such i exists,go to Step 4 else note Pi to be next in the safe sequence
 Step3:
Work := Work + Allocationi
Finish[i] := true
go to step 2.
 Step4: If Finish[i] = true for all i, then the system is in a safe state. print the safe sequence out
else declare state unsafe
Jan 14 '07 #1
1 2262
Killer42
8,435 Expert 8TB
I suspect you'd see a better response to this one in the general Techie Talk forum. It went straight over my head, but if someone can thrash out an algorithm, I'm sure I and others here can translate to VB easily enough.
Jan 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Tzu-Chien Chiu | last post by:
Hi, "What methods do you ever use to optimize the programs?" We're developing a graphics chip emulator in C++, but it's very slow for big scenes. Even though this is a cross-platform software,...
5
by: Chris | last post by:
Hi, I was following the article http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/default.aspx I got everything working until I go the the Progress bar section. Here is where I am...
4
by: Christian Blackburn | last post by:
Hi Gang, I've created a text-based file format. Once I've generated the text to save the file is as it should be in the debug window. However once I write it to a file a " is added to the...
36
by: Cap'n Ahab | last post by:
I have used VB3 - VB6, so learning all this OO stuff is reasonably new to me (although I looked at Java a few years ago). Anyway, I thought I would write a small class to begin with, with a...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
by: monkeycool | last post by:
This is for my intro to computer programming class. Please help me solve these 2 assignments: For the following items, you are to write the source code solution to each problem using the...
4
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I...
12
by: Eps | last post by:
I am starting a new job that involves programming in c# and using ASP.net. I have some experience with c# but have little knowledge of ASP, I would like to get a book about each so I can get some...
5
by: msg2ajay | last post by:
hi, Below getRimData() is a function which will call .js file. It is included in <html:select property="lbrokercd" value="" onchange="document.forms, '/ILICTreasury/banker-web/X32.do',...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.