Need a promela program that will start with an integer stack

Assignment Help Computer Engineering
Reference no: EM132081309

You need a promela (SPIN) program that will start with an integer stack of 100 tokens.

It will then create two child processes that will remove 1 token at a time from the stack when they reach the critical section, and keep a local count of tokens that are removed.

The child processes will also randomly determine if a token is one of three categories: Sunny, Cloudy, and Rainy.

If they pop a token off the global stack and it is determined to be a Raniy token, it will not be counted in the local count of the process that popped it off.

In the end the processes will print to the screen a count of tokens they popped off. All of this must be done using Peterson's Mutex Algorithm.

Reference no: EM132081309

Questions Cloud

Write a program which asks the user the enter four strings : Write a C++ program which asks the user the enter 4 C-strings: fileName1, fileName2, word1, and word2.
Design a program to read all numbers into an array : Assume that a file containing a series of integers is named numbers.txt. Design a program to read all numbers into an array.
Display the student name with the highest score : Store ten student names and their individual score in a text file such as Notepad. There will be one score per student.
Calculate the cost per equivalent : ACC203 – Management Accounting - Calculate the cost per equivalent for both direct material and conversion during June. Use weighted average process costing
Need a promela program that will start with an integer stack : You need a promela (SPIN) program that will start with an integer stack of 100 tokens.
Calculate and analyze the debt ratio : Calculate and analyze the debt ratio, and time interest earned for the last two years from the SEC Form 10-K
Split between preferred and common stock : How would I figure out WACC, especially when Equity is split between Preferred and Common Stock?
Write a python code for project named virtual election booth : Voter generates a pair of private and public keys - for the purpose of digital signature. Voter uses his private key to sign his request and the public key.
Conversion value of the bond : With the common stock selling at $37, what is the conversion value of the bond?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd