SMP4: Thread Scheduler (PART 1)
======================
INSTRUCTIONS
============
1. OVERVIEW
===========
In this MP, you will write a user-mode thread scheduler. The basic purpose
of a scheduler is to multiplex use of the computer across several threads
of execution. This MP deals with two different scheduling policies: FIFO
and Round Robin. You will implement both, for use in a simple cooperative
multi-threading system. Along the way, you'll also learn about implementing
object-oriented constructs in low-level procedural languages like C.
This assignment consists of implementing the core functionality of the
scheduler (Step 4) and answering 10 questions (Step 5). Code for
Step 4 goes in sched_impl.c and sched_impl.h.
2. THEORY OF OPERATION
======================
The given code in the MP defines the skeleton of a scheduler together with a
parameterized dummy workload. The idea is when you run the MP, you specify
a scheduling policy, scheduler queue size, some number of worker threads to
create, and, optionally, the number of iterations for which the worker
threads should run. The basic code that parses command line arguments and
creates these worker threads is provided in the MP, but you must implement
the core synchronization and scheduling operations.
As provided, the MP only includes the "dummy" scheduling algorithm, which
doesn't even try to do anything. You can run it like this:
make
./scheduler -dummy 0 N # where N is some number of worker threads
All threads run right away regardless of the queue size (even zero!), and
are scheduled by the operating system. The goal of this MP is to create
scheduler implementations which are a bit more controlled and predictable.
For example, once you have completed the MP, the following should work:
./scheduler -fifo 1 2 3
Main: running 2 workers on 1 queue_size for 3 iterations
Main: detaching worker thread 3075984304
Main: detaching worker thread 3065494448
Main: waiting for scheduler 3086474160
Thread 3075984304: in scheduler queue
Thread 3075984304: loop 0
Thread 3075984304: loop 1
Thread 3075984304: loop 2
Thread 3075984304: exiting
Thread 3065494448: in scheduler queue
Thread 3065494448: loop 0
Thread 3065494448: loop 1
Thread 3065494448: loop 2
Thread 3065494448: exiting
Scheduler: done!
The command line options used above specify:
-fifo Use FIFO scheduling policy
1 One thread can be in the scheduler queue at a time
2 Create 2 worker threads
3 Each thread runs for 3 time slices
Here's another example:
./scheduler -rr 10 2 3
Main: running 2 workers on 10 queue_size for 3 iterations
Main: detaching worker thread 3075828656
Main: detaching worker thread 3065338800
Main: waiting for scheduler 3086318512
Thread 3075828656: in scheduler queue
Thread 3065338800: in scheduler queue
Thread 3075828656: loop 0
Thread 3065338800: loop 0
Thread 3075828656: lo.
SMP4: Thread Scheduler
======================
INSTRUCTIONS
============
1. OVERVIEW
===========
In this MP, you will write a user-mode thread scheduler. The basic purpose
of a scheduler is to multiplex use of the computer across several threads
of execution. This MP deals with two different scheduling policies: FIFO
and Round Robin. You will implement both, for use in a simple cooperative
multi-threading system. Along the way, you'll also learn about implementing
object-oriented constructs in low-level procedural languages like C.
This assignment consists of implementing the core functionality of the
scheduler (Step 4) and answering 10 questions (Step 5). Code for
Step 4 goes in sched_impl.c and sched_impl.h.
2. THEORY OF OPERATION
======================
The given code in the MP defines the skeleton of a scheduler together with a
parameterized dummy workload. The idea is when you run the MP, you specify
a scheduling policy, scheduler queue size, some number of worker threads to
create, and, optionally, the number of iterations for which the worker
threads should run. The basic code that parses command line arguments and
creates these worker threads is provided in the MP, but you must implement
the core synchronization and scheduling operations.
As provided, the MP only includes the "dummy" scheduling algorithm, which
doesn't even try to do anything. You can run it like this:
make
./scheduler -dummy 0 N # where N is some number of worker threads
All threads run right away regardless of the queue size (even zero!), and
are scheduled by the operating system. The goal of this MP is to create
scheduler implementations which are a bit more controlled and predictable.
For example, once you have completed the MP, the following should work:
./scheduler -fifo 1 2 3
Main: running 2 workers on 1 queue_size for 3 iterations
Main: detaching worker thread 3075984304
Main: detaching worker thread 3065494448
Main: waiting for scheduler 3086474160
Thread 3075984304: in scheduler queue
Thread 3075984304: loop 0
Thread 3075984304: loop 1
Thread 3075984304: loop 2
Thread 3075984304: exiting
Thread 3065494448: in scheduler queue
Thread 3065494448: loop 0
Thread 3065494448: loop 1
Thread 3065494448: loop 2
Thread 3065494448: exiting
Scheduler: done!
The command line options used above specify:
-fifo Use FIFO scheduling policy
1 One thread can be in the scheduler queue at a time
2 Create 2 worker threads
3 Each thread runs for 3 time slices
Here's another example:
./scheduler -rr 10 2 3
Main: running 2 workers on 10 queue_size for 3 iterations
Main: detaching worker thread 3075828656
Main: detaching worker thread 3065338800
Main: waiting for scheduler 3086318512
Thread 3075828656: in scheduler queue
Thread 3065338800: in scheduler queue
Thread 3075828656: loop 0
Thread 3065338800: loop 0
Thread 3075828656: loop 1
T.
ECET 360 help A Guide to career/Snaptutorialpinck2380
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
ECET 360 help A Guide to career/Snaptutorialpinck200
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
The following program demonstrates about the pointer variable, * and & operators.
3. Passing parameters to function by pointers
4. Using Structures in C
This document provides specifications for a programming assignment to simulate operating system processes. Students will write a program comparing at least two scheduling algorithms. The simulation will include queues, a CPU, and I/O device. It will process a stream of jobs with various CPU and I/O bursts. Output will include statistics on wait times, throughput, and more to compare algorithm performance. Extra credit options include additional algorithms, preemption, multiple CPUs/devices, and enhanced reporting.
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
Ecet 360 Enthusiastic Study / snaptutorial.comStephenson34
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
The following program demonstrates about the pointer variable, * and & operators
Machine Learning (ML) models are often composed as pipelines of operators, from “classical” ML operators to pre-processing and featurization operators. Current systems deploy pipelines as "black boxes”, where the same implementation of training is run for inference. This solution is convenient but leaves large room to improve performance and resource usage. This talk presents Pretzel, a framework for deployment of ML pipelines that is inspired to Database Systems: Pretzel inspects and optimizes pipelines end-to-end much like queries, and manages resources common to multiple pipelines such as operators' state. Pretzel is joint work with University of Seoul and Microsoft Research and has recently been presented at OSDI ’18. After the overview, this talk also shows experimental results of Pretzel against state-of-art ML solutions and discusses limitations and extensions.
SMP4: Thread Scheduler
======================
INSTRUCTIONS
============
1. OVERVIEW
===========
In this MP, you will write a user-mode thread scheduler. The basic purpose
of a scheduler is to multiplex use of the computer across several threads
of execution. This MP deals with two different scheduling policies: FIFO
and Round Robin. You will implement both, for use in a simple cooperative
multi-threading system. Along the way, you'll also learn about implementing
object-oriented constructs in low-level procedural languages like C.
This assignment consists of implementing the core functionality of the
scheduler (Step 4) and answering 10 questions (Step 5). Code for
Step 4 goes in sched_impl.c and sched_impl.h.
2. THEORY OF OPERATION
======================
The given code in the MP defines the skeleton of a scheduler together with a
parameterized dummy workload. The idea is when you run the MP, you specify
a scheduling policy, scheduler queue size, some number of worker threads to
create, and, optionally, the number of iterations for which the worker
threads should run. The basic code that parses command line arguments and
creates these worker threads is provided in the MP, but you must implement
the core synchronization and scheduling operations.
As provided, the MP only includes the "dummy" scheduling algorithm, which
doesn't even try to do anything. You can run it like this:
make
./scheduler -dummy 0 N # where N is some number of worker threads
All threads run right away regardless of the queue size (even zero!), and
are scheduled by the operating system. The goal of this MP is to create
scheduler implementations which are a bit more controlled and predictable.
For example, once you have completed the MP, the following should work:
./scheduler -fifo 1 2 3
Main: running 2 workers on 1 queue_size for 3 iterations
Main: detaching worker thread 3075984304
Main: detaching worker thread 3065494448
Main: waiting for scheduler 3086474160
Thread 3075984304: in scheduler queue
Thread 3075984304: loop 0
Thread 3075984304: loop 1
Thread 3075984304: loop 2
Thread 3075984304: exiting
Thread 3065494448: in scheduler queue
Thread 3065494448: loop 0
Thread 3065494448: loop 1
Thread 3065494448: loop 2
Thread 3065494448: exiting
Scheduler: done!
The command line options used above specify:
-fifo Use FIFO scheduling policy
1 One thread can be in the scheduler queue at a time
2 Create 2 worker threads
3 Each thread runs for 3 time slices
Here's another example:
./scheduler -rr 10 2 3
Main: running 2 workers on 10 queue_size for 3 iterations
Main: detaching worker thread 3075828656
Main: detaching worker thread 3065338800
Main: waiting for scheduler 3086318512
Thread 3075828656: in scheduler queue
Thread 3065338800: in scheduler queue
Thread 3075828656: loop 0
Thread 3065338800: loop 0
Thread 3075828656: loop 1
T.
ECET 360 help A Guide to career/Snaptutorialpinck2380
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
ECET 360 help A Guide to career/Snaptutorialpinck200
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
The following program demonstrates about the pointer variable, * and & operators.
3. Passing parameters to function by pointers
4. Using Structures in C
This document provides specifications for a programming assignment to simulate operating system processes. Students will write a program comparing at least two scheduling algorithms. The simulation will include queues, a CPU, and I/O device. It will process a stream of jobs with various CPU and I/O bursts. Output will include statistics on wait times, throughput, and more to compare algorithm performance. Extra credit options include additional algorithms, preemption, multiple CPUs/devices, and enhanced reporting.
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
Ecet 360 Enthusiastic Study / snaptutorial.comStephenson34
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
The following program demonstrates about the pointer variable, * and & operators
Machine Learning (ML) models are often composed as pipelines of operators, from “classical” ML operators to pre-processing and featurization operators. Current systems deploy pipelines as "black boxes”, where the same implementation of training is run for inference. This solution is convenient but leaves large room to improve performance and resource usage. This talk presents Pretzel, a framework for deployment of ML pipelines that is inspired to Database Systems: Pretzel inspects and optimizes pipelines end-to-end much like queries, and manages resources common to multiple pipelines such as operators' state. Pretzel is joint work with University of Seoul and Microsoft Research and has recently been presented at OSDI ’18. After the overview, this talk also shows experimental results of Pretzel against state-of-art ML solutions and discusses limitations and extensions.
Round Robin is a CPU scheduling algorithm where each process is assigned a fixed time quantum to execute before being preempted. It aims to provide fair access to the CPU by allowing short processes to not be blocked by long processes. The group plans to understand the Round Robin algorithm by analyzing its concept, designing and implementing a program to demonstrate it, and presenting their work to the guide. They will collect information on the algorithm from resources like computers, MS Word, and web browsers.
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using AutomataDaniel Bristot de Oliveira
This document discusses modeling the behavior of threads in the PREEMPT RT Linux kernel using automata. It proposes an automata-based model to describe and verify thread management code using a modular approach with generators and specifications. The model was integrated with Linux's tracing features, which helped catch an inefficiency bug in the scheduler code and lead to a kernel improvement. Future work includes expanding the model to support interrupts, locks, and multi-core behavior.
The document discusses pipeline computing and its various types and applications. It defines pipeline computing as a technique to decompose a sequential process into parallel sub-processes that can execute concurrently. There are two main types - linear and non-linear pipelines. Linear pipelines use a single reservation table while non-linear pipelines use multiple tables. Common applications of pipeline computing include instruction pipelines in CPUs, graphics pipelines in GPUs, software pipelines using pipes, and HTTP pipelining. The document also discusses implementations of pipeline computing and its advantages like reduced cycle time and increased instruction throughput.
Short and comprehensive manual to extend your local matlab with a high performance computing cluster of NVidia tesla's 2070 graphical processing units.
The document provides tips for improving the performance of MATLAB code. It discusses using the profiler to identify bottlenecks, preallocating arrays to avoid dynamic resizing overhead, and how the Just-In-Time accelerator can speed up loops and functions by avoiding interpretation. Preallocating arrays is shown to improve the speed of examples by over 3 times, and is beneficial for cases where the final array size may vary. The JIT accelerator most effectively accelerates code using supported data types, array shapes, and language elements within loops and conditionals.
7 ways to execute scheduled jobs with pythonHugo Shi
The document discusses 7 different ways to execute scheduled jobs with Python including Apscheduler, crontab, AWS cron jobs, Celery periodic tasks, Timeloop, queue-based decoupled scheduling, and Apache Airflow. It provides details on how each option works and when it would be best to use each one. For example, it notes that Apscheduler is easy to use and supports various backends for job storage, while crontab allows managing cron jobs programmatically from Python code. The document aims to outline options for automating Python and data science solutions through job scheduling.
Many Machine Learning inference workloads compute predictions based on a limited number of models that are deployed together in the system. These models often share common structure and state. This scenario provides large rooms for optimizations of runtime and memory, which current systems fall short in exploring because they employ a black-box model of ML models and tasks, thus being unaware of optimization and sharing opportunities.
On the opposite side, Pretzel adopts a white-box description of ML models, which allows the framework to perform optimizations over deployed models and running tasks, saving memory and increasing the overall system performance. In this talk we will show the motivations behind Pretzel, its current design and possible future developments.
The document discusses clock-driven scheduling for real-time systems. It covers key concepts like static schedules, cyclic executives, frame size constraints, job slicing, and algorithms for constructing static schedules. Notations are introduced to represent periodic tasks, and assumptions made for clock-driven scheduling are explained. Methods to improve the average response time of aperiodic jobs through slack stealing are also summarized.
A Domain-Specific Embedded Language for Programming Parallel Architectures.Jason Hearne-McGuiness
This document proposes a domain-specific embedded language (DSEL) for programming parallel architectures. The DSEL aims to enable parallelism while avoiding issues like deadlocks, race conditions, and complex APIs. It presents the grammar and properties of the proposed DSEL, including that it generates schedules that are deadlock-free and race-condition free. Examples demonstrating data flow and data parallelism using the DSEL are also provided.
CIS*3110 Winter 2016
CIS*3110 (Operating Systems)
Assignment 2: CPU Simulation
Due Date: Sunday, March 6, 2016 at 23:59.
Requirements and Specifications
Objective
The goal of this assignment is to develop a CPU scheduling algorithm that will complete the
execution of a group of multi-threaded processes in an OS that understands threads (kernel
threads). Since a real implementation of your scheduling algorithm is not feasible, you will
implement a simulation of your CPU scheduling algorithm. Each process will have 1-50 threads;
each of the threads has its own CPU and I/O requirements. The simulated scheduling policy is on
the thread level. While your simulation will have access to all the details of the processes that need
to execute, your CPU scheduling algorithm CANNOT take advantage of future knowledge.
Specification
Given a set of processes to execute with CPU and I/O requirements, your CPU simulator will
simulate the execution of the threads based on your developed CPU scheduling policies (FCFS
and RR). Your simulation will collect the following statistics:
• the total time required to execute all the threads in all the processes
• the CPU utilization (NOT the CPU efficiency)
• the average turnaround time for all the processes
• the service time (or CPU time), I/O time and turnaround time for each individual thread
Your simulation structure should be a next event simulation. The next event approach to simulation
is the most common simulation model. At any given time, the simulation is in a single state. The
simulation state can only change at event times, where an event is defined as an occurrence that
may change the state of the system.
Events in this CPU simulation are the following:
• thread arrival
• the transition of a thread state (e.g. when an interrupt occurs due to a time slice, the thread
moves from running state to ready state).
Each event occurs at a specified time. Since the simulation state only changes at an event, the
clock can be advanced to the next most recently scheduled event (the meaning of next event
simulation model).
CIS*3110 Winter 2016
Events are scheduled via an event queue. The event queue is a sorted queue which contains
"future" events; the queue is sorted by the time of these "future" events. The event queue is
initialized to contain the arrival of all threads. The main loop of the simulation consists of processing
the next event, perhaps adding more future events in the queue as a result, advancing the clock,
and so on until all threads have terminated.
Simulation Execution
Your simulation program will be invoked as:
simcpu [-d] [-v] [-r quantum] < input_file
where
• -d stands for detailed information
• -v stands for verbose mode
• –r indicates Round Robin scheduling with the given quantum (an integer).
You can assume only these flags will be used with your program, and that they will appear in the
order listed. The output for the de ...
Dimensional performance benchmarking of SQLBrendan Furey
This document summarizes a presentation on dimensional performance benchmarking of SQL. It introduces a framework for defining data sets in terms of parameters (x,y) and running queries across a 2D grid to capture performance metrics. Six examples are described that demonstrate different SQL techniques for problems like bursting, hierarchies, and string splitting. The results show how performance varies based on data size and shape. The framework allows rigorous and automated testing of SQL performance.
Here is a recursive C function that solves the Tower of Hanoi problem:
#include <stdio.h>
void towerOfHanoi(int n, char from_rod, char to_rod, char aux_rod)
{
if (n == 0)
return;
towerOfHanoi(n-1, from_rod, aux_rod, to_rod);
printf("Move disk %d from rod %c to rod %c\n", n, from_rod, to_rod);
towerOfHanoi(n-1, aux_rod, to_rod, from_rod);
}
int main()
{
int
This document summarizes the results of simulating a manufacturing system model with three parts: arrival of components, processing of components, and the main production process. The simulation found a bottleneck at machine 2, with the longest queue times. Several proposals to improve system performance were explored using a process analyzer tool, with scenario 2 found to spread queue times more evenly and reduce bottlenecks at a reasonable cost, and scenario 5 found to give the best results by further reducing wait times and balancing utilization across resources.
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesMarina Kolpakova
This document provides an overview of pragmatic optimization approaches for modern programming. It discusses understanding code and algorithms, optimizing memory access patterns, minimizing operations, and shrinking critical paths. Hardware-specific optimizations and diving into assembly are also covered. The key lessons are to find and optimize critical code sections, gain knowledge of the code, compiler, and platform, and apply optimizations in an iterative process starting from high-level choices before making low-level changes. Recommended literature on computer architecture, optimization, and compiler engineering is provided.
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfsravi07
Write a program in C or C++ which simulates CPU scheduling in an operating system. There is
only one
CPU. The scheduling algorithm you will implement is FCFS. You can implement Round Robin
for extra
credits. You are suggested but not required to use standard template library data structures such
as vector
and deque.
This program is lengthier than previous assignments. Please allocate sufficient time.
Assumptions:
(a) We will assume the processes engage in CPU bursts, Input bursts
and Output bursts, ignoring other interrupts.
(b) We will assume that all processes are doing Input through the
same device which can process one Input burst at a time.
(b) We will assume that all processes are doing Output through the
same device which can process one Output burst at a time.
(c) We will assume the system starts out with no processes active.
There may be processes ready to start at once.
Data structures:
You will need a struct or class to represent one process.
The program requires 4 queues: Entry, Ready, Input and Output. You can use
deque for the queues (unless you prefer to write your own implementation of
queue). The items stored on the queues are pointers to processes. You can
think of Entry queue as the queue where the processes reside (e.g. on disk
swap space) before they are loaded into memory.
You can also have variables Active, IActive and OActive (pointers to
processes), which points to the active processes on the CPU, the input device
and the output device, respectively.
Constants:
You can declare the following constants:
MAX_TIME is an integer = length of the whole run. Use the value 500.
IN_USE is an integer = maximum number of processes that can be in play at
once (that is, Active/IOActive processes if any, plus those that are in
Ready/IO queues). Use the value 5.
2
HOW_OFTEN is an integer indicating how often to reprint the state of
the system. Use the value 25.
You may declare some other optional constants. They are not necessary if you
choose to use STL:
QUEUE_SIZE is an integer guaranteed larger than the maximum number of
items any queue will ever hold. Use the value 20.
ARRAY_SIZE is an integer = size of the array to define in a process. It is
the maximum number of bursts for a process. Use the value 10.
Feel free to add more constants as you see fit.
The process data structure:
A process needs to contain (at least) the following data:
ProcessName is the name of the process, a string.
ProcessID is an integer, the ID number for the process. This is assigned
by the system (i.e., your program). Use consecutive values such as 101,
102, 103, etc.
History is an array or vector of pairs of the form (letter, value). They
are from the supplied input file, described below.
Sub is a subscript into the array/vector History
CPUTimer counts clock ticks for the process until it reaches
the end of the CPU burst for FCFS (or end of the quantum for RR).
IOTimer counts clock ticks for the process until it reaches the end of the
I/O burst. You need t.
It seemed that long forum debates about methods of measuring algorithm's running time, functions to use and precision that should be expected were over. Unfortunately, we have to return to this question once again. Today we will discuss the question how we should measure speed of a parallel algorithm.
This document provides guidance on writing structured Verilog testbenches. It discusses elements that should be included in testbenches such as parameter definitions, preprocessor directives, timescale directives, include statements, input registers, output wires, device under test instantiation, initial conditions, test vector generation, debug output, using memory, and events. It gives an example of a basic testbench and improves it by adding parameters. Structured testbenches allow for easier readability, modification, and expansion compared to unstructured testbenches.
Have you ever wondered how to speed up your code in Python? This presentation will show you how to start. I will begin with a guide how to locate performance bottlenecks and then give you some tips how to speed up your code. Also I would like to discuss how to avoid premature optimization as it may be ‘the root of all evil’ (at least according to D. Knuth).
This document describes an efficient dynamic scheduling algorithm for real-time multi-core systems. It proposes a task split myopic scheduling algorithm that exploits parallelism in tasks to meet deadlines. The algorithm splits tasks that cannot meet their deadline into mandatory and optional sub-tasks, which can then execute concurrently on multiple cores. Simulation studies show the proposed algorithm has higher schedulability than myopic and improved myopic algorithms. The algorithm aims to better utilize executing cores to increase the probability of tasks meeting their deadlines while maintaining a low computational complexity of O(kn), the same as myopic algorithms.
Social Media and the Modern Impact of InformaticsWrite an es.docxpbilly1
Social Media and the Modern Impact of Informatics
Write an essay addressing each of the following points/questions. Be sure to completely answer all the questions for each number item. There should be three sections, one for each item number below, as well the introduction (heading is the title of the essay) and conclusion paragraphs. Separate each section in your paper with a clear heading that allows your professor to know which bullet you are addressing in that section of your paper. Support your ideas with at least three (3) scholarly citations using APA citations in your essay. Make sure to reference the citations using the APA writing style for the essay. The cover page and reference page do not count towards the minimum word amount. Review the rubric criteria for this assignment.
Most people remember the story below that made national headlines. As most Americans have smart phones, tablets, and computers the utilization of social media is common place.
Finley, T. (2017, Sept. 20). Navy hospital removes staffers for calling babies ‘mini Satan’s’ on social media.
Parenting
.
If you were writing a hospital policy on smart phone and social media usage, what should be included in the policy?
What potential ethical and legal liabilities are there for the hospital and employees in the case presented above?
In 2007, Harvard University rescinded admission to 10 students after reviewing their social media post.
Do you feel potential employers, current employers, and colleges have the right to access your social media post? Do you feel employers and universities should make decisions based on your post?
Discuss the relationship between accreditation decisions, reimbursement, quality of care, informatics.
.
Social Media and the global marketplace Web 2.0 Business .docxpbilly1
Social Media and the global marketplace: Web 2.0
Business Models
Readings:
Wirtz, B.W., Schilke, O. and Ullrich, S., 2010. Strategic development of
business models: implications of the Web 2.0 for creating value on the
internet. Long Range Planning, 43(2), pp.272-290.
INB 20009 Managing the Global Marketplace
Lesson plan
• Social Media and digital business models
• Socio-cultural research (Verstehen school of thought)
1) Socio-Cultural Research: The social as capital
2) Socio-Cultural Research: The social as theatre
• Stages of Internationalisation
• A Strategic Approach to Internationalisation: A Traditional Versus a
‘Born-Global’ Approach :
• Implications and recommendations
PART 1
CONCEPTS
A BUSINESS MODEL
• The business model is a holistic management
approach that reflects the fundamental value
creation logic, value creation architecture and the
functioning of a company (Timmers 1998).
• A representation of a firm’s underlying core logic and
strategic choices for creating and capturing value
within a value network (Shafer, S.M., Smith, H.J.
and Linder, J.C., 2005 p.202).
A BUSINESS MODEL…contd
• Porter (1985) distinguishes nine value chain elements. Namely, as
primary elements inbound logistics, operations, outbound logistics,
marketing & sales, service; and as support activities technology
development, procurement, human resource management,
corporate infrastructure.
Components of a business model
Source: (Shafer, S.M., Smith, H.J. and Linder, J.C., 2005 p.202).
The 4C-Net-Business-Model typology
(Wirtz 2000; Wirtz and Lihotzky 2003, p. 522)
• A typology to structure the different business
models on the Internet within the B2C sector.
• Four basic business models are characterised
by different service offerings across Content,
Commerce, Context and Connection.
• The classification is considered as 4C-Net-
Business-Model typology (Wirtz 2000, p. 218).
Content, Commerce, Context and
Connection
• Content-orientated business models are used by firms -
such as The Wall Street Journal Online - that focus on
the collection, selection, compilation, distribution, and/or
presentation of online content.
• Their value proposition is to provide convenient, user-
friendly online access to various types of relevant
content.
Content, Commerce, Context and
Connection
• Commerce-orientated business models focus primarily
on the initiation, negotiation, payment and delivery
aspects of trade transactions using online media.
• Commerce-oriented firms, such as Amazon and Dell,
offer cost-efficient transactions for buyers and sellers of
goods and services.
• Companies focusing on this type of business model use
electronic Internet-based processes to substitute or
support traditional transaction functions and arenas,
creating direct revenue streams in the form of sales
revenues, as well as indirect revenue streams such as
commissions.
Content, Commer.
More Related Content
Similar to SMP4 Thread Scheduler (PART 1)======================INSTR.docx
Round Robin is a CPU scheduling algorithm where each process is assigned a fixed time quantum to execute before being preempted. It aims to provide fair access to the CPU by allowing short processes to not be blocked by long processes. The group plans to understand the Round Robin algorithm by analyzing its concept, designing and implementing a program to demonstrate it, and presenting their work to the guide. They will collect information on the algorithm from resources like computers, MS Word, and web browsers.
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using AutomataDaniel Bristot de Oliveira
This document discusses modeling the behavior of threads in the PREEMPT RT Linux kernel using automata. It proposes an automata-based model to describe and verify thread management code using a modular approach with generators and specifications. The model was integrated with Linux's tracing features, which helped catch an inefficiency bug in the scheduler code and lead to a kernel improvement. Future work includes expanding the model to support interrupts, locks, and multi-core behavior.
The document discusses pipeline computing and its various types and applications. It defines pipeline computing as a technique to decompose a sequential process into parallel sub-processes that can execute concurrently. There are two main types - linear and non-linear pipelines. Linear pipelines use a single reservation table while non-linear pipelines use multiple tables. Common applications of pipeline computing include instruction pipelines in CPUs, graphics pipelines in GPUs, software pipelines using pipes, and HTTP pipelining. The document also discusses implementations of pipeline computing and its advantages like reduced cycle time and increased instruction throughput.
Short and comprehensive manual to extend your local matlab with a high performance computing cluster of NVidia tesla's 2070 graphical processing units.
The document provides tips for improving the performance of MATLAB code. It discusses using the profiler to identify bottlenecks, preallocating arrays to avoid dynamic resizing overhead, and how the Just-In-Time accelerator can speed up loops and functions by avoiding interpretation. Preallocating arrays is shown to improve the speed of examples by over 3 times, and is beneficial for cases where the final array size may vary. The JIT accelerator most effectively accelerates code using supported data types, array shapes, and language elements within loops and conditionals.
7 ways to execute scheduled jobs with pythonHugo Shi
The document discusses 7 different ways to execute scheduled jobs with Python including Apscheduler, crontab, AWS cron jobs, Celery periodic tasks, Timeloop, queue-based decoupled scheduling, and Apache Airflow. It provides details on how each option works and when it would be best to use each one. For example, it notes that Apscheduler is easy to use and supports various backends for job storage, while crontab allows managing cron jobs programmatically from Python code. The document aims to outline options for automating Python and data science solutions through job scheduling.
Many Machine Learning inference workloads compute predictions based on a limited number of models that are deployed together in the system. These models often share common structure and state. This scenario provides large rooms for optimizations of runtime and memory, which current systems fall short in exploring because they employ a black-box model of ML models and tasks, thus being unaware of optimization and sharing opportunities.
On the opposite side, Pretzel adopts a white-box description of ML models, which allows the framework to perform optimizations over deployed models and running tasks, saving memory and increasing the overall system performance. In this talk we will show the motivations behind Pretzel, its current design and possible future developments.
The document discusses clock-driven scheduling for real-time systems. It covers key concepts like static schedules, cyclic executives, frame size constraints, job slicing, and algorithms for constructing static schedules. Notations are introduced to represent periodic tasks, and assumptions made for clock-driven scheduling are explained. Methods to improve the average response time of aperiodic jobs through slack stealing are also summarized.
A Domain-Specific Embedded Language for Programming Parallel Architectures.Jason Hearne-McGuiness
This document proposes a domain-specific embedded language (DSEL) for programming parallel architectures. The DSEL aims to enable parallelism while avoiding issues like deadlocks, race conditions, and complex APIs. It presents the grammar and properties of the proposed DSEL, including that it generates schedules that are deadlock-free and race-condition free. Examples demonstrating data flow and data parallelism using the DSEL are also provided.
CIS*3110 Winter 2016
CIS*3110 (Operating Systems)
Assignment 2: CPU Simulation
Due Date: Sunday, March 6, 2016 at 23:59.
Requirements and Specifications
Objective
The goal of this assignment is to develop a CPU scheduling algorithm that will complete the
execution of a group of multi-threaded processes in an OS that understands threads (kernel
threads). Since a real implementation of your scheduling algorithm is not feasible, you will
implement a simulation of your CPU scheduling algorithm. Each process will have 1-50 threads;
each of the threads has its own CPU and I/O requirements. The simulated scheduling policy is on
the thread level. While your simulation will have access to all the details of the processes that need
to execute, your CPU scheduling algorithm CANNOT take advantage of future knowledge.
Specification
Given a set of processes to execute with CPU and I/O requirements, your CPU simulator will
simulate the execution of the threads based on your developed CPU scheduling policies (FCFS
and RR). Your simulation will collect the following statistics:
• the total time required to execute all the threads in all the processes
• the CPU utilization (NOT the CPU efficiency)
• the average turnaround time for all the processes
• the service time (or CPU time), I/O time and turnaround time for each individual thread
Your simulation structure should be a next event simulation. The next event approach to simulation
is the most common simulation model. At any given time, the simulation is in a single state. The
simulation state can only change at event times, where an event is defined as an occurrence that
may change the state of the system.
Events in this CPU simulation are the following:
• thread arrival
• the transition of a thread state (e.g. when an interrupt occurs due to a time slice, the thread
moves from running state to ready state).
Each event occurs at a specified time. Since the simulation state only changes at an event, the
clock can be advanced to the next most recently scheduled event (the meaning of next event
simulation model).
CIS*3110 Winter 2016
Events are scheduled via an event queue. The event queue is a sorted queue which contains
"future" events; the queue is sorted by the time of these "future" events. The event queue is
initialized to contain the arrival of all threads. The main loop of the simulation consists of processing
the next event, perhaps adding more future events in the queue as a result, advancing the clock,
and so on until all threads have terminated.
Simulation Execution
Your simulation program will be invoked as:
simcpu [-d] [-v] [-r quantum] < input_file
where
• -d stands for detailed information
• -v stands for verbose mode
• –r indicates Round Robin scheduling with the given quantum (an integer).
You can assume only these flags will be used with your program, and that they will appear in the
order listed. The output for the de ...
Dimensional performance benchmarking of SQLBrendan Furey
This document summarizes a presentation on dimensional performance benchmarking of SQL. It introduces a framework for defining data sets in terms of parameters (x,y) and running queries across a 2D grid to capture performance metrics. Six examples are described that demonstrate different SQL techniques for problems like bursting, hierarchies, and string splitting. The results show how performance varies based on data size and shape. The framework allows rigorous and automated testing of SQL performance.
Here is a recursive C function that solves the Tower of Hanoi problem:
#include <stdio.h>
void towerOfHanoi(int n, char from_rod, char to_rod, char aux_rod)
{
if (n == 0)
return;
towerOfHanoi(n-1, from_rod, aux_rod, to_rod);
printf("Move disk %d from rod %c to rod %c\n", n, from_rod, to_rod);
towerOfHanoi(n-1, aux_rod, to_rod, from_rod);
}
int main()
{
int
This document summarizes the results of simulating a manufacturing system model with three parts: arrival of components, processing of components, and the main production process. The simulation found a bottleneck at machine 2, with the longest queue times. Several proposals to improve system performance were explored using a process analyzer tool, with scenario 2 found to spread queue times more evenly and reduce bottlenecks at a reasonable cost, and scenario 5 found to give the best results by further reducing wait times and balancing utilization across resources.
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesMarina Kolpakova
This document provides an overview of pragmatic optimization approaches for modern programming. It discusses understanding code and algorithms, optimizing memory access patterns, minimizing operations, and shrinking critical paths. Hardware-specific optimizations and diving into assembly are also covered. The key lessons are to find and optimize critical code sections, gain knowledge of the code, compiler, and platform, and apply optimizations in an iterative process starting from high-level choices before making low-level changes. Recommended literature on computer architecture, optimization, and compiler engineering is provided.
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfsravi07
Write a program in C or C++ which simulates CPU scheduling in an operating system. There is
only one
CPU. The scheduling algorithm you will implement is FCFS. You can implement Round Robin
for extra
credits. You are suggested but not required to use standard template library data structures such
as vector
and deque.
This program is lengthier than previous assignments. Please allocate sufficient time.
Assumptions:
(a) We will assume the processes engage in CPU bursts, Input bursts
and Output bursts, ignoring other interrupts.
(b) We will assume that all processes are doing Input through the
same device which can process one Input burst at a time.
(b) We will assume that all processes are doing Output through the
same device which can process one Output burst at a time.
(c) We will assume the system starts out with no processes active.
There may be processes ready to start at once.
Data structures:
You will need a struct or class to represent one process.
The program requires 4 queues: Entry, Ready, Input and Output. You can use
deque for the queues (unless you prefer to write your own implementation of
queue). The items stored on the queues are pointers to processes. You can
think of Entry queue as the queue where the processes reside (e.g. on disk
swap space) before they are loaded into memory.
You can also have variables Active, IActive and OActive (pointers to
processes), which points to the active processes on the CPU, the input device
and the output device, respectively.
Constants:
You can declare the following constants:
MAX_TIME is an integer = length of the whole run. Use the value 500.
IN_USE is an integer = maximum number of processes that can be in play at
once (that is, Active/IOActive processes if any, plus those that are in
Ready/IO queues). Use the value 5.
2
HOW_OFTEN is an integer indicating how often to reprint the state of
the system. Use the value 25.
You may declare some other optional constants. They are not necessary if you
choose to use STL:
QUEUE_SIZE is an integer guaranteed larger than the maximum number of
items any queue will ever hold. Use the value 20.
ARRAY_SIZE is an integer = size of the array to define in a process. It is
the maximum number of bursts for a process. Use the value 10.
Feel free to add more constants as you see fit.
The process data structure:
A process needs to contain (at least) the following data:
ProcessName is the name of the process, a string.
ProcessID is an integer, the ID number for the process. This is assigned
by the system (i.e., your program). Use consecutive values such as 101,
102, 103, etc.
History is an array or vector of pairs of the form (letter, value). They
are from the supplied input file, described below.
Sub is a subscript into the array/vector History
CPUTimer counts clock ticks for the process until it reaches
the end of the CPU burst for FCFS (or end of the quantum for RR).
IOTimer counts clock ticks for the process until it reaches the end of the
I/O burst. You need t.
It seemed that long forum debates about methods of measuring algorithm's running time, functions to use and precision that should be expected were over. Unfortunately, we have to return to this question once again. Today we will discuss the question how we should measure speed of a parallel algorithm.
This document provides guidance on writing structured Verilog testbenches. It discusses elements that should be included in testbenches such as parameter definitions, preprocessor directives, timescale directives, include statements, input registers, output wires, device under test instantiation, initial conditions, test vector generation, debug output, using memory, and events. It gives an example of a basic testbench and improves it by adding parameters. Structured testbenches allow for easier readability, modification, and expansion compared to unstructured testbenches.
Have you ever wondered how to speed up your code in Python? This presentation will show you how to start. I will begin with a guide how to locate performance bottlenecks and then give you some tips how to speed up your code. Also I would like to discuss how to avoid premature optimization as it may be ‘the root of all evil’ (at least according to D. Knuth).
This document describes an efficient dynamic scheduling algorithm for real-time multi-core systems. It proposes a task split myopic scheduling algorithm that exploits parallelism in tasks to meet deadlines. The algorithm splits tasks that cannot meet their deadline into mandatory and optional sub-tasks, which can then execute concurrently on multiple cores. Simulation studies show the proposed algorithm has higher schedulability than myopic and improved myopic algorithms. The algorithm aims to better utilize executing cores to increase the probability of tasks meeting their deadlines while maintaining a low computational complexity of O(kn), the same as myopic algorithms.
Similar to SMP4 Thread Scheduler (PART 1)======================INSTR.docx (20)
Social Media and the Modern Impact of InformaticsWrite an es.docxpbilly1
Social Media and the Modern Impact of Informatics
Write an essay addressing each of the following points/questions. Be sure to completely answer all the questions for each number item. There should be three sections, one for each item number below, as well the introduction (heading is the title of the essay) and conclusion paragraphs. Separate each section in your paper with a clear heading that allows your professor to know which bullet you are addressing in that section of your paper. Support your ideas with at least three (3) scholarly citations using APA citations in your essay. Make sure to reference the citations using the APA writing style for the essay. The cover page and reference page do not count towards the minimum word amount. Review the rubric criteria for this assignment.
Most people remember the story below that made national headlines. As most Americans have smart phones, tablets, and computers the utilization of social media is common place.
Finley, T. (2017, Sept. 20). Navy hospital removes staffers for calling babies ‘mini Satan’s’ on social media.
Parenting
.
If you were writing a hospital policy on smart phone and social media usage, what should be included in the policy?
What potential ethical and legal liabilities are there for the hospital and employees in the case presented above?
In 2007, Harvard University rescinded admission to 10 students after reviewing their social media post.
Do you feel potential employers, current employers, and colleges have the right to access your social media post? Do you feel employers and universities should make decisions based on your post?
Discuss the relationship between accreditation decisions, reimbursement, quality of care, informatics.
.
Social Media and the global marketplace Web 2.0 Business .docxpbilly1
Social Media and the global marketplace: Web 2.0
Business Models
Readings:
Wirtz, B.W., Schilke, O. and Ullrich, S., 2010. Strategic development of
business models: implications of the Web 2.0 for creating value on the
internet. Long Range Planning, 43(2), pp.272-290.
INB 20009 Managing the Global Marketplace
Lesson plan
• Social Media and digital business models
• Socio-cultural research (Verstehen school of thought)
1) Socio-Cultural Research: The social as capital
2) Socio-Cultural Research: The social as theatre
• Stages of Internationalisation
• A Strategic Approach to Internationalisation: A Traditional Versus a
‘Born-Global’ Approach :
• Implications and recommendations
PART 1
CONCEPTS
A BUSINESS MODEL
• The business model is a holistic management
approach that reflects the fundamental value
creation logic, value creation architecture and the
functioning of a company (Timmers 1998).
• A representation of a firm’s underlying core logic and
strategic choices for creating and capturing value
within a value network (Shafer, S.M., Smith, H.J.
and Linder, J.C., 2005 p.202).
A BUSINESS MODEL…contd
• Porter (1985) distinguishes nine value chain elements. Namely, as
primary elements inbound logistics, operations, outbound logistics,
marketing & sales, service; and as support activities technology
development, procurement, human resource management,
corporate infrastructure.
Components of a business model
Source: (Shafer, S.M., Smith, H.J. and Linder, J.C., 2005 p.202).
The 4C-Net-Business-Model typology
(Wirtz 2000; Wirtz and Lihotzky 2003, p. 522)
• A typology to structure the different business
models on the Internet within the B2C sector.
• Four basic business models are characterised
by different service offerings across Content,
Commerce, Context and Connection.
• The classification is considered as 4C-Net-
Business-Model typology (Wirtz 2000, p. 218).
Content, Commerce, Context and
Connection
• Content-orientated business models are used by firms -
such as The Wall Street Journal Online - that focus on
the collection, selection, compilation, distribution, and/or
presentation of online content.
• Their value proposition is to provide convenient, user-
friendly online access to various types of relevant
content.
Content, Commerce, Context and
Connection
• Commerce-orientated business models focus primarily
on the initiation, negotiation, payment and delivery
aspects of trade transactions using online media.
• Commerce-oriented firms, such as Amazon and Dell,
offer cost-efficient transactions for buyers and sellers of
goods and services.
• Companies focusing on this type of business model use
electronic Internet-based processes to substitute or
support traditional transaction functions and arenas,
creating direct revenue streams in the form of sales
revenues, as well as indirect revenue streams such as
commissions.
Content, Commer.
Social Media and the Boston Marathon Bombings A Case StudyB.docxpbilly1
Social Media and the Boston Marathon Bombings: A Case Study
By:
George Haddow and Kim Haddow
, Posted on: June 4, 2015
As we reach the final stretch of the capital trial of the Boston Marathon bomber, we present this case study on social media that was originally published in the author’s book
Disaster Communications in a Changing Media World
:
Case Study: BPD and Social Media
At 2:49 PM on April 15, 2013 two bombs exploded near the finish line of the annual Boston Marathon killing three people and injuring 264. The first reports about the about the terrorist attack were spread through Twitter and Facebook.
At 2:59 PM the
Boston Globe
tweeted:
“BREAKING NEWS: Two powerful explosions detonated in quick succession right next to the Boston Marathon finish line this afternoon.”
Minutes later, the Boston Police Department confirmed the explosion in a tweet. And in a separate tweet soon after reported:
“22 injured. 2 dead
#tweetfromthebeat
via
@CherylFiandaca
”
According to Topsy, a Twitter analytics company, at around 4:10 p.m. there were more than 300,000 mentions on Twitter of “Boston explosions.” (Stern, 2013) In a second wave of social media, details about the event spread. Media that included photos of blood covering the ground and a six-second Vine video of the actual explosion was circulated, deepening people’s sense of what had happened. Around 4:30 p.m., there were more than 700,000 mentions on Twitter of the “Boston Marathon.” (Stern, 2013)
Even though television was the most widely-used source of information about the bombing and its aftermath, it was social media that shaped the story and the response. While 80% of Americans followed the story on TV according to the Pew Research Center, about half (49%) say they kept up with news and information online or on a mobile device and a quarter of Americans got information about the explosions and the hunt for the bombers on social networking sites such as Facebook and Twitter.
Young Americans in particular kept up-to-date through social media. Slightly more than half (56%) of an 18-to-29 year subgroup polled by Pew got bombing-related news through social networking sites. (Pew Research Center, 2013).
The Boston bombings and the manhunt that followed became the backdrop for the world to witness the transformation – for good and for bad — in news gathering and distribution, and in disaster management and crises communications caused by social media platforms and technology. The Boston Marathon bombings were a watershed, a moment that marked forever the changed role of social media and the fully participatory public in breaking news events and coverage. The
New York Times
wrote:
It is America’s first fully interactive national tragedy of the social media age.” (Kakutani, 2013)
From marathon runners giving their accounts on Facebook, to law enforcement officials using Twitter to give real-time updates and asking for help identifying and capturing the suspects, to th.
Social media and adolescence, is it good bad When looking at the c.docxpbilly1
Social media and adolescence, is it good? bad? When looking at the current adolescent generation, social media has become an important influencer. How many likes to I have? How many friends do I have? Am I pretty? etc. are common questions that are asked internally. In this chapter, we were introduced to new thinking patterns and concepts related to this developmental stage, such as personal fable, invincibility fable, egocentrism, etc.
For this assignment, address the following,
How does the influence of social media impact concepts like personal fable, invincibility fable, egocentrism, etc.?
What are the benefits to social media? (think about technology as a whole as well)
How can social media and/or technology hinder development during this stage?
.
Social Media - Public Information OfficerOne of the challeng.docxpbilly1
Social Media - Public Information Officer
One of the challenges facing the Public Information Officer (PIO) is social media. Social media is both a friend and foe of emergency agencies.
1. What is the role and responsibilities of the PIO?
2. And what do Twitter, Facebook, and other social media sites mean these days to the PIO?
3. Using the internet or professional journals,
find two articles and post the links to the two articles
. One of these should show how
an emergency agency uses social media in a positive manner, such as to inform and involve the local community being served.
4. The other link should show
how social media was used in an unprofessional manner and made the agency involved look bad in the eyes of the public.
5. Give a one paragraph summary of each link.
400-450 words excluding reference, APA style format and a minimum of 3 references.
.
Social marketing applies commercial marketing strategies to promot.docxpbilly1
The document discusses social marketing strategies for promoting measles, mumps, and rubella (MMR) vaccination among young children in developing countries. It covers key concepts in social marketing like consumer orientation, audience segmentation, communication channels, and process tracking. A social marketing model is presented involving 6 steps: planning strategies, selecting communication channels, generating and pretesting materials, implementation, assessment, and feedback. The overall approach aims to address misgivings about the MMR vaccine and encourage its administration through education and awareness campaigns.
Social Justice and Family Policy Dr. Williams Instructi.docxpbilly1
Social Justice and Family Policy
Dr. Williams
Instructions for the Critical Essay
Utilizing seven to ten outside scholarly sources students are to write critical essays (5-7 pages not
including title and reference pages) documenting an essential issue with regard to the course’s influence
on a policy. Students may also include official and organizational research reports as part of their
allotted references too1. These essays are positional in nature (you’re arguing a stance using scholarly
evidence), and will be written in an academic and scholarly tone. Arguments must be cogent, logical,
and supported by facts (which will come from one’s research). APA citation and reference lists are
required. These essays will be well proof-read before submission. Font: Times New Roman, 12. The
essay should be double-spaced and numbered. Below are instructions regarding the format:
1. The assignment requires a traditional APA title page. Students may assign the essay its own
title, be creative. Again, the title page and references are not counted in the page requirement.
2. The structure of the paper should be sectioned like such:
a. Introduction
b. The Policy (here you will provide an explanation/background of your chosen policy)
c. Corresponding Issue #1
d. Corresponding Issue #2
e. Suggested Policy Change
f. Conclusion
g. References
3. The Introduction should provide a thorough roadmap of where you intend to take the reader;
thus, here you want to establish a clear but brief outline of your policy of choice and the issues
you plan to uncover—leave the rest for folks to see in the essay. This should be no more than a
good thick paragraph.
4. The proceeding pages should be well structured by sections/headings which will correspond to
remaining four points mentioned after the introduction. For example, for a policy one may
choose sentencing, and then his/her two issues may be mass incarceration and reentry (you’d
use those titles as the headings for your sections in the essay, or you can be more creative and
call them something else, but the sections need to be distinct from each other). The
information contained in each respective section will include a meshing together of your
scholarly sources and your understanding of your chosen policy. This part of the essay will
become more refined as one continue to engage in research. Remember, all points/arguments
explained in these pages must be cited and backed by evidence. Your writing should be both
informative and persuasive, which means you should be explaining to your reader the gist of the
1. These are the sources that will give one the statistics he/she would need to describe the scope of the
problem/issue which will be covered in the essay. It is important that the essay has some stats in it to substantiate
all arguments. For instance, for crime stats see .
SOCIAL JUSTICE AND SOCIOLOGYAGENDAS FOR THETWENTY-FIR.docxpbilly1
SOCIAL JUSTICE AND SOCIOLOGY:
AGENDAS FOR THE
TWENTY-FIRST CENTURY
JOE R, FEAGIN
University of Florida
The world's peoples face daunting challenges in the
twenty-first century. While apologists herald the globaliza-
tion of capitalism, many people on our planet experience
recurring economic exploitation, immiseration, and envi-
ronmental crises linked to capitalism's spread. Across the
globe social movements continue to raise the issues of
social justice and democracy. Given the new century's
serious challenges, sociologists need to rediscover their
roots in a sociology committed to social justice, to cultivate and extend the long-
standing "countersystem" approach to research, to encourage greater self-reflection
in sociological analysis, and to re-emphasize the importance ofthe teaching of soci-
ology. Finally, more sociologists should examine the big social questions of this
century, including the issues of economic exploitation, social oppression, and the
looming environmental crises. And, clearly, more sociologists should engage in the
study of alternative social futures, including those of more just and egalitarian soci-
eties. Sociologists need to think deeply and imaginatively about sustainable social
futures and to aid in building better human societies.
WE STAND today at the beginning ofa challenging new century. Like
ASA Presidents before me, I am conscious
of the honor and the responsibility that this
address carries with it, and I feel a special
obligation to speak about the role of sociol-
ogy and sociologists in the twenty-first cen-
tury. As we look forward, let me quote W. E.
B. Du Bois, a pathbreaking U.S. sociologist.
In his last autobiographical statement, Du
Bois (1968) wrote:
Direct correspondence to Joe R. Feagin, De-
partment of Sociology, Box 117330, University
of Florida, Gainesville, FL 32611, (feagin®
ufl.edu). I would like to thank the numerous col-
leagues who made helpful comments on various
drafts of this presidential address. Among these
were Hernan Vera, Sidney Willhelm, Bernice
McNair Barnett, Gideon Sjoherg, Anne Rawls,
Mary Jo Deegan, Michael R. Hill, Patricia
Lengermann, Jill Niebrugge-Brantley, Tony
Orum, William A. Smith, Ben Agger, Karen
Pyke, and Leslie Houts.
[TJoday the contradictions of American civi-
lization are tremendous. Freedom of politi-
cal discussion is difficult; elections are not
free and fair. . . . The greatest power in the
land is not thought or ethics, but wealth. . . .
Present profit is valued higher than future
need. . . . I know the United States. It is my
country and the land of my fathers. It is still
a land of magnificent possibilities. It is still
the home of noble souls and generous
people. But it is selling its birthright. It is
betraying its mighty destiny. (Pp. 418-19)
Today the social contradictions of Ameri-
can and global civilizations are still im-
mense. Many prominent voices tell us that it
is the best of times; other voices insist that it
is the worst of t.
Social Justice Analysis of a Current Issue The effects of the O.docxpbilly1
Social Justice Analysis of a Current Issue: The effects of the Opioid Epidemic in urban communities
the most recent edition of the APA manual).
In 3-4 pages, title and references apply course frameworks to a contentious current social welfare policy issue
.
Social issue - BullyingIdentify and summarize the contemporary s.docxpbilly1
Social issue - Bullying
Identify and summarize the contemporary social issue you selected (Bullying), citing resources to strengthen your summary. Explain what is happening in the issue, and provide a brief history of how the issue began.
**See the attached file for additional questions and instructions on how to answer the questions using PowerPoint **
.
Social InterestA key component of Adlers theory is what he call.docxpbilly1
Social Interest
A key component of Adler's theory is what he calls "social interest." He maintains that social interest is an important criterion for a healthy personality. Adler also talks about inferiority and compensation in his theory of personality.
On the basis of your understanding on "social interest," discuss the following:
Write about a public figure from popular culture, such as politics, movies, or television.
Explain how social interest is or was a factor in his or her personality development.
Explain how factors such as inferiority and compensation are displayed in your subject's personality.
Support your responses with examples. Cite any sources in APA format.
.
Social Interaction AssignmentPurpose To research a social.docxpbilly1
Social Interaction Assignment
Purpose:
To research a social setting and observe social interaction.
Instructions:
Visit an area where you can discretely observe social interaction (i.e., a cafeteria, a restaurant, the mall, a social event, etc.) and complete the summary and analysis below. Before conducting your observation, review the following concepts from your text:
Review the symbolic interaction approach (pages 20-22)
Chapter 5: Socialization
Chapter 6: Social Interaction in Everyday Life
The Activity:
Spend some time (minimum of 15 minutes) quietly observing what is going on and briefly summarize what different persons in the setting were doing.
Summary and Analysis:
Once you have completed your observation and made notes, analyze the patterns of social interaction that you observed and respond to the following:
1) Describe the context for your observation. This includes the location, setting, type of people observed, time of day, day of week length of observation, etc. You may also include any other details you deem relevant.
2) What examples of socialization did you notice? This may include the process of socialization in progress (i.e. a parent encouraging their child to use good table manners) or evidence of the effects of socialization (i.e. waiting politely in a long line).
3) Give at least three examples of each of the following that you observed during your interaction: ascribed status, achieved status, and roles.
4) Describe at least five examples of social exchange that you noticed and discuss the potential impact (helpful, disruptive, etc.) on the individuals involved.
5) What examples of “gendered” interaction did you notice regarding the ways in which women and men are socialized regarding demeanor, uses of space, starting, touching, smiling, and language. Explain whether or not this was consistent with what you learned in chapter 6 (pages 165-166 and 170).
Mechanics:
Assignments must be a minimum of one page, single spaced, typed, standard 8.5x11 page, 1” margins, Times New Roman or Arial 10-12 point font, and include your name/course/assignment title/date.
.
Social Institutions are a part of our everyday life. What is a socia.docxpbilly1
Social Institutions are a part of our everyday life. What is a social institution? How do social institutions effect your life? Write a one-page paper about the micro and macro implications of social institutions that you have read about in this module. What theoretical implications can you uncover? Why do you think it is important to study social institutions?
.
Social Institutions Paper#2 topic is one of those below .docxpbilly1
Social Institutions
Paper#2 topic is one of those below
1. Economy (Topic: Feminization of Poverty)
2. Education (Topics: Inequality (individual and /or structural) or School Violence)
3. The Elderly (Topics: Ageism/Discrimination or Elder Abuse)
.
Social InjusticeInstructionsPlease complete the following s.docxpbilly1
This document provides instructions for a discussion post on social injustice and pop culture. Students are asked to consider how pop culture has promoted social justice by giving specific examples. They are also asked to share a unique example of how pop culture has influenced public opinion to promote equality, justice, acceptance or tolerance. Finally, students are asked whether people with a large pop culture following have an ethical responsibility to promote positive messages, and they must validate their opinions with citations.
Social injustice in educationincluded in my PowerPoint was 1.docxpbilly1
Social injustice in education
included in my PowerPoint was
1. How education affect children poverty
2. how immigrants struggle in education and their mental health
3. LGBTQ how they struggle in education and their mental health
4. The discipline in school like certain rules that are in placed that affect them
needs to be 6 pages and I need at least four references
.
Social Injustice, Jack Johnson, pro boxer how did racism influen.docxpbilly1
Social Injustice,
Jack Johnson, pro boxer how did racism influence his professional life.
Muhammad Ali, how did his refusal to go into the army affect his professional career.
Tommy Smith, what happened to him after coming home from the Olympics at the raising his fist.
LeBron James, what has been his influence in today’s society when it pertains to social injustices.
.
Social influence is not always negative. In some instances, it may.docxpbilly1
Social influence is not always negative. In some instances, it may be used to promote beneficial behaviors. Are the decisions made by individuals in response to positive social influences more valid than those made in response to negative social influences? Why or why not? [Provide 2 references and 2 intext citations]
.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
1. SMP4: Thread Scheduler (PART 1)
======================
INSTRUCTIONS
============
1. OVERVIEW
===========
In this MP, you will write a user-mode thread scheduler. The
basic purpose
of a scheduler is to multiplex use of the computer across several
threads
of execution. This MP deals with two different scheduling
policies: FIFO
and Round Robin. You will implement both, for use in a simple
cooperative
multi-threading system. Along the way, you'll also learn about
implementing
object-oriented constructs in low-level procedural languages
like C.
This assignment consists of implementing the core functionality
2. of the
scheduler (Step 4) and answering 10 questions (Step 5). Code
for
Step 4 goes in sched_impl.c and sched_impl.h.
2. THEORY OF OPERATION
======================
The given code in the MP defines the skeleton of a scheduler
together with a
parameterized dummy workload. The idea is when you run the
MP, you specify
a scheduling policy, scheduler queue size, some number of
worker threads to
create, and, optionally, the number of iterations for which the
worker
threads should run. The basic code that parses command line
arguments and
creates these worker threads is provided in the MP, but you
must implement
the core synchronization and scheduling operations.
As provided, the MP only includes the "dummy" scheduling
3. algorithm, which
doesn't even try to do anything. You can run it like this:
make
./scheduler -dummy 0 N # where N is some number of worker
threads
All threads run right away regardless of the queue size (even
zero!), and
are scheduled by the operating system. The goal of this MP is
to create
scheduler implementations which are a bit more controlled and
predictable.
For example, once you have completed the MP, the following
should work:
./scheduler -fifo 1 2 3
Main: running 2 workers on 1 queue_size for 3 iterations
Main: detaching worker thread 3075984304
Main: detaching worker thread 3065494448
Main: waiting for scheduler 3086474160
Thread 3075984304: in scheduler queue
Thread 3075984304: loop 0
4. Thread 3075984304: loop 1
Thread 3075984304: loop 2
Thread 3075984304: exiting
Thread 3065494448: in scheduler queue
Thread 3065494448: loop 0
Thread 3065494448: loop 1
Thread 3065494448: loop 2
Thread 3065494448: exiting
Scheduler: done!
The command line options used above specify:
-fifo Use FIFO scheduling policy
1 One thread can be in the scheduler queue at a time
2 Create 2 worker threads
3 Each thread runs for 3 time slices
Here's another example:
./scheduler -rr 10 2 3
5. Main: running 2 workers on 10 queue_size for 3 iterations
Main: detaching worker thread 3075828656
Main: detaching worker thread 3065338800
Main: waiting for scheduler 3086318512
Thread 3075828656: in scheduler queue
Thread 3065338800: in scheduler queue
Thread 3075828656: loop 0
Thread 3065338800: loop 0
Thread 3075828656: loop 1
Thread 3065338800: loop 1
Thread 3075828656: loop 2
Thread 3065338800: loop 2
Thread 3075828656: exiting
Thread 3065338800: exiting
Scheduler: done!
The command line options used above specify:
-rr Use Round Robin scheduling policy
10 Ten threads can be in the scheduler queue at a time
6. 2 Create 2 worker threads
3 Each thread runs for 3 time slices
Things to observe:
In both examples, the worker threads are created at the
beginning of
execution. But in the case with queue size 1, one of the threads
has to
wait until the other thread exits before it can enter the scheduler
queue
(the "in scheduler queue" messages). Whereas in the case with
queue size
10, both threads enter the scheduler queue immediately.
The FIFO policy would actually have basically the same
behavior even with a
larger queue size; the waiting worker threads would simply be
admitted to
the queue earlier.
The Round Robin scheduling policy alternates between
executing the two
7. available threads, until they run out of work to do.
3. FILE LAYOUT
==============
The MP distribution consists of the following source files:
scheduler.c
Includes the skeleton of a scheduler (sched_proc()) and a
parameterized dummy workload (worker_proc()). The main()
function
accepts several parameters specifying the test workload (see
description below). The scheduler relies on a scheduler
implementation (sched_impl_t) to implement the specifics of
its
scheduling policy (to be provided by you in sched_impl.[hc])
scheduler.h
Describes the interface to which your scheduler
implementation must
adhere. The structures containing function pointers are similar
to
8. Java interfaces or C++ pure virtual base classes. This file
declares that you must define two sched_impl_t structures,
sched_fifo and sched_rr in another file (sched_impl.c).
dummy_impl.c
Implements the dummy scheduling algorithm, which just lets
the OS
schedule all threads, regardless of queue size.
sched_impl.h (define your data structures here)
This is where you will define the data structures stored per
scheduler instance (struct sched_queue) and per worker thread
(struct thread_info). This will likely include synchronization
constructs like semaphores and mutexes, and a list of threads
available to be scheduled.
sched_impl.c (implement your code here)
This is where you will define the functions implementing the
core
behavior of the scheduler, including the FIFO and Round
Robin
9. scheduling policies. The only way functions defined in this
file
are made available to the main program (scheduler.c) is by
placing
function pointers in the sched_impl_t structures sched_fifo and
sched_rr.
list.h
Defines the basic operations on a bidirectional linked list data
structure. The elements of the list, of type list_elem_t,
include
a void *datum where you can store pointers to whatever kind
of
data you like. You don't have to use this linked list library,
but it will probably come in handy.
list.c
Implements the linked list operations.
smp4_tests.c
testrunner.c
10. testrunner.h
Test harness, defines test cases for checking your MP solution.
Please take a look at the source files and familiarize yourself
with how
they work. Think about how structures containing function
pointers compare
to classes and virtual methods in C++. If you'd like to learn
more, read
about the virtual function table in C++. The struct containing
function
pointers technique employed in this MP is also used by C GUI
libraries like
GTK+ and to define the operations of loadable modules, such as
file systems,
within the Linux kernel.
4. PROGRAMMING
==============
Now you're ready to implement the core of the scheduler,
including the FIFO
and Round Robin scheduling algorithms. For this purpose, you
11. should only
modify sched_impl.h and sched_impl.c. Please see scheduler.h
for the
descriptions of what functions you must implement. You are
free to put
whatever you want in the thread_info and sched_queue
structures. Note that
the only way that the functions you implement are made
available to the main
program is through the sched_impl_t structures sched_fifo and
sched_rr. See
dummy_impl.c for a completed example of how to fill in a
sched_impl_t.
Suggested approach:
4.1 Create stub versions of all of the functions you will need to
implement
in sched_impl.c, and statically initialize sched_fifo and
sched_rr.
4.2 Figure out how you will implement the scheduler queue, add
the
appropriate fields to struct sched_queue, and fill in the
appropriate
12. queue-related operations in the functions you created in
(4.1).
Remember that we provide a doubly-linked list in list.[hc].
4.3 Implement scheduler queue admission control, so that only
the requested
number of threads can be in the scheduler queue at once.
Create the
appropriate synchronization constructs to prevent threads not
in the
queue from executing (look at the implementation of worker
threads in
scheduler.c:worker_proc()).
4.4 Implement the queue operations for selecting the next thread
to execute.
This will be different for FIFO vs. Round Robin scheduling.
4.5 Add in synchronization constructs to make sure only the
selected thread
executes at any given time.
4.6 Fill in any gaps that might remain.
13. When you think you're done, you can test your program using
the command
"make test". For more thorough testing, the fifo_var and rr_var
tests
accept queue_size, num_workers, and num_iterations arguments
just like the
main program (but is mandatory for the test case):
./scheduler -test fifo_var
./scheduler -test rr_var
5. QUESTIONS
============
Q 1 What are some pros and cons of using the struct of
function pointers
approach as we did in the MP to link different modules?
Does it
significantly affect performance? Give some examples of
when you would
and wouldn't use this approach, and why.
Q 2 Briefly describe the synchronization constructs you needed
14. to implement
this MP--i.e., how you mediated admission of threads to the
scheduler
queue and how you made sure only the scheduled thread
would run at any
given time.
Q 3 Why is the dummy scheduling implementation provided
potentially
unsafe (i.e. could result in invalid memory references)?
How does
your implementation avoid this problem?
Q 4 When using the FIFO or Round Robin scheduling
algorithm, can
sched_proc() ever "miss" any threads and exit early before
all threads
have been scheduled and run to completion? If yes, give an
example; if
no, explain why not.
Q 5 Why are the three variables in scheduler.h declared
'extern'? What
would happen if they were not declared 'extern'? What
15. would happen
if they were not declared without the 'extern' in any file?
Q 6 Describe the behavior of exit_error() function in
scheduler.c. Why
does exit_error() not use errno?
Q 7 Does it matter whether the call to sched_ops-
>wait_for_queue(queue) in
sched_proc() actually does anything? How would it affect
correctness
if it just returned right away? How about performance?
Q 8 Explain how worker_proc() is able to call the appropriate
implementation of wait_for_cpu() corresponding to the
scheduling policy
selected by the user on the command line. Start from main()
and
briefly explain each step along the way.
Q 9 Is it possible that a worker thread would never proceed
past the call to
wa->ops->wait_for_cpu(&wa->info) when using one of the
scheduling
16. policies implemented in this MP?
Q 10 Explain how you would alter the program to demonstrate
the "convoy"
effect, when a large compute bound job that never yields to
another
thread slows down all other jobs in a FIFO scheduled
system? See Page
402, Stallings, the paragraph starting "Another difficulty
with FCFS is
that it tends to favor processor-bound processes over I/O
bound
processes". Why is it difficult to show the benefits of
Round Robin
scheduling in this case using the current implementation in
the machine
problem?
...............................................................................................
....................................
SMP5: Scheduler with Signals (PART 2)
17. ============================
This MP is a variation of SMP4.
In the last MP, we built a simulated OS process scheduler. The
scheduler can
hold only a certain number of processes (workers) at one time.
Once the process
has been accepted into the scheduler, the scheduler decides in
what order the
processes execute. We implemented two scheduling algorithms:
FIFO and Round
Robin.
In this MP, we are to simulate a time-sharing system by using
signals and
timers. We will only implement the Round Robin algorithm.
Instead of using
iterations to model the concept of "time slices" (as in the last
MP), we use
interval timers. The scheduler is installed with an interval
timer. The timer
starts ticking when the scheduler picks a thread to use the CPU
which in turn
18. signals the thread when its time slice is finished thus allowing
the scheduler
to pick another thread and so on. When a thread has completely
finished its work
it leaves the scheduler to allow a waiting thread to enter. Please
note that in
this MP, only the timer and scheduler send signals. The threads
passively handle
the signals without signaling back to the scheduler.
The program takes a number of arguments. Arg1 determines the
number of jobs
(threads in our implementation) created; arg2 specifies the
queue size of the
scheduler. Arg3 through argN gives the duration (the required
time slices to
complete a job) of each job. Hence if we create 2 jobs, we
should supply arg3
and arg4 for the required duration. You can assume that the
autograder will
always supply the correct number of arguments and hence you
do not have to
detect invalid input.
19. Here is an example of program output, once the program is
complete:
% scheduler 3 2 3 2 3
Main: running 3 workers with queue size 2 for quanta:
3 2 3
Main: detaching worker thread 3075926960.
Main: detaching worker thread 3065437104.
Main: detaching worker thread 3054947248.
Main: waiting for scheduler 3086416816.
Scheduler: waiting for workers.
Thread 3075926960: in scheduler queue.
Thread 3075926960: suspending.
Thread 3065437104: in scheduler queue.
Thread 3065437104: suspending.
Scheduler: scheduling.
Scheduler: resuming 3075926960.
Thread 3075926960: resuming.
Scheduler: suspending 3075926960.
22. Thread 3054947248: suspending.
Thread 3054947248: resuming.
Scheduler: suspending 3054947248.
Thread 3054947248: leaving scheduler queue.
Thread 3054947248: terminating.
The total wait time is 12.062254 seconds.
The total run time is 7.958618 seconds.
The average wait time is 4.020751 seconds.
The average run time is 2.652873 seconds.
The goal of this MP is to help you understand (1) how signals
and timers work,
and (2) how to evaluate the performance of your program. You
will first
implement the time-sharing system using timers and signals.
Then, you will
evaluate the overall performance of your program by keeping
track of how long
each thread is idle, running, etc.
23. The program will use these four signals:
SIGALRM: sent by the timer to the scheduler, to indicate
another time
quantum has passed.
SIGUSR1: sent by the scheduler to a worker, to tell it to
suspend.
SIGUSR2: sent by the scheduler to a suspended worker, to tell
it to resume.
SIGTERM: sent by the scheduler to a worker, to tell it to
cancel.
You will need to set up the appropriate handlers and masks for
these signals.
You will use these functions:
clock_gettime
pthread_sigmask
pthread_kill
sigaction
sigaddset
sigemptyset
24. sigwait
timer_settime
timer_create
Also, make sure you understand how the POSIX:TMR interval
timer works.
There are two ways you can test your code. You can run the
built-in grading
tests by running "scheduler -test -f0 rr". This runs 5 tests, each
of which can
be run individually. You can also test you program with
specific parameters by
running "scheduler -test gen ..." where the ellipsis contains the
parameters you
would pass to scheduler.
Programming
===========
Part I: Modify the scheduler code (scheduler.c)
-----------------------------------------------
25. We use the scheduler thread to setup the timer and handle the
scheduling for the
system. The scheduler handles the SIGALRM events that come
from the timer, and
sends out signals to the worker threads.
Step 1.
Modify the code in init_sched_queue() function in scheduler.c
to initialize the
scheduler with a POSIX:TMR interval timer. Use
CLOCK_REALTIME in timer_create().
The timer will be stored in the global variable "timer", which
will be started
in scheduler_run() (see Step 4 below).
Step 2.
Implement setup_sig_handlers(). Use sigaction() to install
signal handlers for
SIGALRM, SIGUSR1, and SIGTERM. SIGALRM should
trigger timer_handler(), SIGUSR1
26. should trigger suspend_thread(), and SIGTERM should trigger
cancel_thread().
Notice no handler is installed for SIGUSR2; this signal will be
handled
differently, in step 8.
Step 3.
In the scheduler_run() function, start the timer. Use
timer_settime(). The
time quantum (1 second) is given in scheduler.h. The timer
should go off
repeatedly at regular intervals defined by the timer quantum.
In Round-Robin, whenever the timer goes off, the scheduler
suspends the
currently running thread, and tells the next thread to resume its
operations
using signals. These steps are listed in timer_handler(), which is
called every
time the timer goes off. In this implementation, the timer
handler makes use of
suspend_worker() and resume_worker() to accomplush these
steps.
27. Step 4.
Complete the suspend_worker() function. First, update the
info->quanta value.
This is the number of quanta that remain for this thread to
execute. It is
initialized to the value passed on the command line, and
decreases as the thread
executes. If there is any more work for this worker to do, send
it a signal to
suspend, and update the scheduler queue. Otherwise, cancel the
thread.
Step 5.
Complete the cancel_worker() function by sending the
appropriate signal to the
thread, telling it to kill itself.
Step 6.
Complete the resume_worker() function by sending the
appropriate signal to the
thread, telling it to resume execution.
28. Part II: Modify the worker code (worker.c)
------------------------------------------
In this section, you will modify the worker code to correctly
handle the signals
from the scheduler that you implemented in the previous
section.
You need to modify the thread functions so that it immediately
suspends the
thread, waiting for a resume signal from the scheduler. You will
need to use
sigwait() to force the thread to suspend itself and wait for a
resume signal.
You need also to implement a signal handler in worker.c to
catch and handle the
suspend signals.
Step 7.
Modify start_worker() to (1) block SIGUSR2 and SIGALRM,
and (2) unblock SIGUSR1
29. and SIGTERM.
Step 8.
Implement suspend_thread(), the handler for the SIGUSR1
signal. The
thread should block until it receives a resume (SIGUSR2)
signal.
Part III: Modify the evaluation code (scheduler.c)
--------------------------------------------------
This program keeps track of run time, and wait time. Each
thread saves these
two values regarding its own execution in its thread_info_t.
Tracking these
values requires also knowing the last time the thread suspended
or resumed.
Therefore, these two values are also kept in thread_info_t. See
scheduler.h.
In this section, you will implement the functions that calculate
run time and
wait time. All code that does this will be in scheduler.c. When
30. the program
is done, it will collect all these values, and print out the total
and average
wait time and run time. For your convenience, you are given a
function
time_difference() to compute the difference between two times
in microseconds.
Step 9.
Modify create_workers() to initialize the various time variables.
Step 10.
Implement update_run_time(). This is called by
suspend_worker().
Step 11.
Implement update_wait_time(). This is called by
resume_worker().
Questions
==========
31. Question 1.
Why do we block SIGUSR2 and SIGALRM in worker.c? Why
do we unblock SIGUSR1 and
SIGTERM in worker.c?
Question 2.
We use sigwait() and sigaction() in our code. Explain the
difference between the
two. (Please explain from the aspect of thread behavior rather
than syntax).
Question 3.
When we use POSIX:TMR interval timer, we are using relative
time. What is the
alternative? Explain the difference between the two.
Question 4.
Look at start_worker() in worker.c, a worker thread is executing
within an
infinite loop at the end. When does a worker thread terminate?
Question 5.
32. When does the scheduler finish? Why does it not exit when the
scheduler queue
is empty?
Question 6.
After a thread is scheduled to run, is it still in the sched_queue?
When is it
removed from the head of the queue? When is it removed from
the queue completely?
Question 7.
We've removed all other condition variables in SMP4, and
replaced them with a
timer and signals. Why do we still use the semaphore
queue_sem?
Question 8.
What's the purpose of the global variable "completed" in
scheduler.c? Why do we
compare "completed" with thread_count before we
wait_for_queue() in
next_worker()?
33. Question 9.
We only implemented Round Robin in this SMP. If we want to
implement a FIFO
scheduling algorithm and keep the modification as minimum,
which function in
scheduler.c is the one that you should modify? Briefly describe
how you would
modify this function.
Question 10.
In this implementation, the scheduler only changes threads
when the time quantum
expires. Briefly explain how you would use an additional signal
to allow the
scheduler to change threads in the middle of a time quantum. In
what situations
would this be useful?