Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Seven state process model in operating system

06/12/2021 Client: muhammad11 Deadline: 2 Day

CSci 530: Problem Set 2

Processes and Threads

CSci 430 Summer 2020

Overview

In this written problem set you will be given some exercises in order to help

expand your understanding of the concept of processes and threads and what

functions they perform in a modern operating system.

Learning Objectives

� Better understand processes, process preemption, process modes, etc.

� Explore thread concepts, learn what responsbilities threads handle in

an OS and which aspects are part of processes.

� Begin to understand issues of thread concurrency.

Submission

You are to submit the assignment by the end of the day on the assigned due

date. A submission folder has been created in MyLeoOnline for your use.

This assignment has 2 problems, both requiring a written description and

�gures. So you may submit your answer as a plain text comment, or as an

attachment of a plain text �le, or a word or open o�ce document.

1

Problem #1

For the seven-state process model of Figure 9.b, draw a queueing diagram

similar to that of Figure 3.8b.

Problem #2

Consider the following code using the POSIX Pthreads API:

#include

#include

#include

#include

int myglobal = 0;

void* thread_function(void* arg)

{

int i, j;

for(i = 0; i < 20; i++)

{

j = myglobal;

j = j + 1;

printf(".");

fflush(stdout);

sleep(1);

myglobal = j;

}

return NULL;

}

int main(void)

{

pthread_t mythread;

int i;

if (pthread_create(&mythread, NULL, thread_function, NULL) != 0)

{

printf("error creating thread.");

2

abort();

}

for(i = 0; i < 20; i++)

{

myglobal = myglobal + 1;

printf("o");

fflush(stdout);

sleep(1);

}

if (pthread_join(mythread, NULL))

{

printf("error joining thread.");

abort();

}

printf("\n myglobal equals %d \n", myglobal);

exit(0);

}

In main() we �rst declare a variable called mythread, which has a type

of pthread_t. This is essentially an ID for a thread. Next, the if statement

creates a thread associated with mythread. The call pthread_create() re-

turns zero on success and a nonzero error code on failure. The third argument

of pthread_create() is the name of a function that the new thread will ex-

ecute when it starts. When this thread_function() returns, the thread

terminates. Meanwhile the main program itself de�nes a thread, so there

are two threads executing. The pthread_join() function causes the main

thread to wait until the new thread completes.

Questions

1. What di�erences are there between the loops in the thread_function()

and in main()? Are these di�erences signi�cant? In other words, does

something about the di�ereneces in the loop have implications for when

the two functions are run as concurrent threads.

2. Here is output from the above program being executed

$ ./thread2

3

..o.o.o.o.oo.o.o.o.o.o.o.o.o.o..o.o.o.oo

myglobal equals 21

Is this the output you would expect? If not, what has gone wrong and

how would you �x it (please show code)?

4

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Accounting Homework Help
Finance Professor
Smart Tutor
Quality Homework Helper
Buy Coursework Help
Academic Master
Writer Writer Name Offer Chat
Accounting Homework Help

ONLINE

Accounting Homework Help

I am an experienced researcher here with master education. After reading your posting, I feel, you need an expert research writer to complete your project.Thank You

$16 Chat With Writer
Finance Professor

ONLINE

Finance Professor

I can assist you in plagiarism free writing as I have already done several related projects of writing. I have a master qualification with 5 years’ experience in; Essay Writing, Case Study Writing, Report Writing.

$49 Chat With Writer
Smart Tutor

ONLINE

Smart Tutor

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$40 Chat With Writer
Quality Homework Helper

ONLINE

Quality Homework Helper

I have read your project description carefully and you will get plagiarism free writing according to your requirements. Thank You

$43 Chat With Writer
Buy Coursework Help

ONLINE

Buy Coursework Help

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$25 Chat With Writer
Academic Master

ONLINE

Academic Master

I have written research reports, assignments, thesis, research proposals, and dissertations for different level students and on different subjects.

$34 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Morriston hospital consultants list - Alice mccall warringah mall - Accounting formula assets liabilities equity - APA Citation Tutorial - Solidworks equation syntax error - Monash materials engineering staff - Part three problem sets problem set a answers - Endocrine - Every word of scripture is god breathed - A christmas carol blurb - Report examples for students - Ticehurst nursing home rushmoor - Discussion 2-3 paragraphs - Omicron ct analyzer for sale - Impact of assignment helper on student learning - Gopro case study strategic management - Artworks made using alternative media and processes - Werribee mercy palliative care - How to keep mudeyes alive - Help with my finance homework - Cell structure and function lab answers - Invictus movie summary and analysis - Two page apa format - Great black leaders ancient and modern - Np intertrade pty limi northbridge - Profile essay - How can you contrast intellectual and physical ability - 3.2 possessive adjectives worksheet answers - Researchers who are studying a new shampoo formula plan - Say no to 0780 - Thermodynamics2 - Executive Practical Connection Assignment - Langston hughes cafe 3 am - Leccion 8 en el restaurante - 10 22 cop code - 9. read 1 corinthians 15:42-57 and list three characteristics of the glorified state. - Current risk free rate for capm - Grand chase rufus 4th job - SOCW6210 - 1 page assignment - Nrich factors and multiples - A streetcar named desire themes - Prothero god is not one sparknotes - Here are four industries and four forecasts for the macroeconomy - Starbucks barista espresso machine manual pdf - IT incident response - Piranha dual battery system wiring diagram - The evolution of business ethics - Husky injection molding machine price - Ms project cost estimate - Information technology for managers reynolds pdf - Disadvantages of system analysis and design - History of Mental illness in America - Cwv 101 topic 7 review - In the cemetery where al jolson is buried sparknotes - Conversion course for overseas nurses ecu - Describe the function of the skeletal system - Wk 5, HCS/341: DQ - Regional food laboratory rajkot gujarat - What Makes a Good Writing Assignment? - Is worstest grammatically correct - What instrument is used to measure radioactivity - Students of ever after high - Contra actions to spray tanning - Organizational Paper Review - Il fornello nutritional information - Texas educator ethics training course answers - We mortals are but shadows and dust - Matchbox 20 hang karaoke - Assignment - Application of Concepts from Caring Science (Watson’s Caring Theory as a guide for practice). - Autocorrelation function of white noise - Energy balance equation for heat exchanger - Shareholder analysis - "Statute of Limitations" Please respond to the following: - 5 greek words for love - Label figure 17.7 spinal cord transverse section - Filthy food josh lucas - SOCW 6361 - Properties of metallic compounds - Walt disney world swot analysis - Discussion - Iom future of nursing recommendations - Al3+ ion electron configuration - Met police vetting timescale - Quickbooks chapter 2 end of chapter questions - Dyson market oriented mission statement - Sewing machine sketch with label - Self balancing robot raspberry pi - Fulminated mercury with a little tweak of chemistry - Bsbcus501 assessment 1 - Financial management time value of money questions and answers - Muscle building meal plan pdf - How does a hovercraft skirt work - Edit My Paper Narrative Paper - Case Study on Innovation and marketing of new products: Wework or Gopro - DV Wheels - A Crosscutting issue for Social Workers Discussion Board Question - Heat of solution lab answers - One angel square architect - Cmi calculation - Thesis statement for why college athletes should not be paid