SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
IT-215
         System Software
          Project Report

   Submitted on: 16th April 2012



     Simulation of
manufacture of Sulphuric
         Acid

  Guided By: Prof. Sanjay Chaudhary
   Mentored By: Anadi Chaturvedi




                      Submitted By:
                      Prashant Pandey (201001067)
                      Swena Gupta     (201001104)
Goal
To simulate process automation for a manufacturing plant

Problem Statement
Assume that there is a manufacturing plant, which
manufactures finished products based on processing on raw
materials. There are few machines in the plant. Each
machine inputs raw materials, performs processing and
produces semi-finished product, which is supplied as input
or raw material to another machine. Thus, there is a chain of
machines which are involved in the process inputting raw
materials or semi-finished product and produces semi-
finished product. Finally finished product will be the final
output. Each machine is to be simulated as a process. Various
processes can be initiated independently of each other and
executed in background. Each process may take input from a
specific named pipe and write output as a processed semi-
finished product on some other named pipe. Define the
sequence of actions among 5-7 such machines, define the
flow input and output among them. One machine should be
identified as a machine, which generates finished product,
i.e. gray cloth. Each machine operates under certain
environmental conditions, i.e. machine should be operated
within the range of temperature. If temperature level of any
of the machine is more than the upper limit then it should


                               1
generate signal and send it to the main controlling machine,
which will inform all other machines to stop operations.


Concepts Used
     • Multiple Threading
     • Mutual Exclusion and Condition Variables
     • Inter Process Communication using Pipes
     • Signal Handling and Processing
     • Accessing System time.


Programming Language
C Language inclusive of concepts of Shell Programming.


      used
Tools used
gcc compiler.


Header Files Used
1)     #include <stdio.h>
       This header file contains declarations used in most input
       and output and is typically included in all C programs.
       eg. printf() etc.
2)     #include <stdlib.h>
       This header file contains Utility functions.
       eg. exit() etc.


                                 2
3)    # include <pthread.h>
      This header file defines the threads and its functions.
      eg. pthread_create() etc.
4)    #include <signal.h>
      To catch the various signals implemented in our
      program, we have included <signal.h> because it
      contains sigaction as a structure.
5)     #include <string.h>
      This header file contains String functions.
      eg. strlen()
6)     #include <time.h>
      This header file contains implementation of date and
      time manipulation operations.


Test Programs
a)
time_t now;
time (&now);
printf ("nn%snn", ctime (&now));
//the above code snippet has been used to access system time.
b)
act.sa_handler = catchint;
sigfillset(&(act.sa_mask));
sigaction(SIGINT , &act, NULL);
sigaction(SIGUSR1 , &act, NULL);
void catchint(int signo) // handler for sigaction

                                       3
{
      if(signo==SIGINT)
      printf("nn'Ctrl+C' pressed...Interrupt generated and
ignored!!!nn");
      if(signo==SIGQUIT)
      .
      .
      .
      .
}
// The above code snippet is used to call signals at various
activities of user such as pressing Ctrl+C to generate SIGINT
etc. and to handle them using catchint function.
c)
if(pthread_create(&control_thread, NULL, control_machine, (void *)
quantity)!=0)
{
      printf("Failed to create a threadn");
      exit(1);
}
      pthread_join(control_thread, NULL);


// The above part of program is used to create threads and to
join them
d)
pipe (p);
write (p[1], write_msg, 60);
read(p[0], read_msg, 60);
// the above statements are used to declare and do read-write
operation on a named pipe.
                                        4
e)
pthread_mutex_lock (&count_lock);
while (taskid >= COUNT)
{
     pthread_cond_wait (&count_cond, &count_lock);
}
pthread_cond_broadcast (&count_cond);
pthread_mutex_unlock (&count_lock);


//the above statements are used to put mutual exclusion
amongst all the threads and to make all other threads wait
while one thread is executing.


Assumptions
1.    The Initial & Favourable specifications of machines are
pre-defined as stated in program (while we run the
program, it displays on the console).


2.   According to the code made by us, the specifications has
been set, so that if the required amount is > 3 litres, all the 5
stage proccess machines gets overheated & production of 4th
lts onwards acid needs to cool each machine. This has been
shown appropriately while production of 4th litre and
onwards acid production.




                                    5
3.     This has been done deliberately to introduce and
show the concept of temperature in our machine automated
manufacturing-plant system.


4.     Following SIGNALS have been handled in our program
         a. SIGINT : signal called for handling Ctrl+C.
         b. SIGQUIT : signal called for handling Ctrl+
         c. SIGALRM : signal called for production of next litre
of acid.
         d. SIGWINCH: signal called when output terminal
window size is changed.
         e. SIGTSTP : signal called for handling Ctrl+Z.
         f. SIGUSR1 : signal called if the user enters invalid
input.


List of Programs

     • final_manufacture.c

Log Files
     • log_for_3_litres_prodn
     • log_for_6_litres_prodn
     • log_for_9_litres_prodn
     • log_for_wrong_user_input
     • log_with_all_signals_handled_6_litres


                                  6

Contenu connexe

Tendances

How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program Rumman Ansari
 
Removal Of Recursion
Removal Of RecursionRemoval Of Recursion
Removal Of RecursionRicha Sharma
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5nancydrews
 
03. operators and-expressions
03. operators and-expressions03. operators and-expressions
03. operators and-expressionsStoian Kirov
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01Abdul Samee
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++cpjcollege
 
Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapseindiappsdevelopment
 
My first program in c, hello world !
My first program in c, hello world !My first program in c, hello world !
My first program in c, hello world !Rumman Ansari
 
[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing Algorithms[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing AlgorithmsUniversidad de los Andes
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c programNishmaNJ
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structureRumman Ansari
 
C program to write c program without using main function
C program to write c program without using main functionC program to write c program without using main function
C program to write c program without using main functionRumman Ansari
 

Tendances (17)

How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program
 
C++20 features
C++20 features C++20 features
C++20 features
 
20BCE1734.pdf
20BCE1734.pdf20BCE1734.pdf
20BCE1734.pdf
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Removal Of Recursion
Removal Of RecursionRemoval Of Recursion
Removal Of Recursion
 
Signal
SignalSignal
Signal
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5
 
03. operators and-expressions
03. operators and-expressions03. operators and-expressions
03. operators and-expressions
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++
 
Loops in c
Loops in cLoops in c
Loops in c
 
Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3
 
My first program in c, hello world !
My first program in c, hello world !My first program in c, hello world !
My first program in c, hello world !
 
[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing Algorithms[CCC'21] Evaluation of Work Stealing Algorithms
[CCC'21] Evaluation of Work Stealing Algorithms
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structure
 
C program to write c program without using main function
C program to write c program without using main functionC program to write c program without using main function
C program to write c program without using main function
 

En vedette

Современные материалы для пассивного дома
Современные материалы для пассивного домаСовременные материалы для пассивного дома
Современные материалы для пассивного домаIngvar Lav
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
Incorporating multimedia in differentiated instruction
Incorporating multimedia in differentiated instructionIncorporating multimedia in differentiated instruction
Incorporating multimedia in differentiated instructionewalterjr
 
умный дом презентация
умный дом презентацияумный дом презентация
умный дом презентацияIngvar Lav
 
применение солнечной энергии для теплоснабжения объектов
применение солнечной энергии для теплоснабжения объектовприменение солнечной энергии для теплоснабжения объектов
применение солнечной энергии для теплоснабжения объектовIngvar Lav
 

En vedette (9)

Современные материалы для пассивного дома
Современные материалы для пассивного домаСовременные материалы для пассивного дома
Современные материалы для пассивного дома
 
Sweet life
Sweet lifeSweet life
Sweet life
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Incorporating multimedia in differentiated instruction
Incorporating multimedia in differentiated instructionIncorporating multimedia in differentiated instruction
Incorporating multimedia in differentiated instruction
 
CakePHP3使ってみて
CakePHP3使ってみてCakePHP3使ってみて
CakePHP3使ってみて
 
умный дом презентация
умный дом презентацияумный дом презентация
умный дом презентация
 
Manual epson
Manual epsonManual epson
Manual epson
 
применение солнечной энергии для теплоснабжения объектов
применение солнечной энергии для теплоснабжения объектовприменение солнечной энергии для теплоснабжения объектов
применение солнечной энергии для теплоснабжения объектов
 

Similaire à Lab report 201001067_201001104

Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfWrite a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfsravi07
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPIyaman dua
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxstilliegeorgiana
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxdenneymargareta
 
Raspberry pi Part 6
Raspberry pi Part 6Raspberry pi Part 6
Raspberry pi Part 6Techvilla
 
Flow based programming in golang
Flow based programming in golangFlow based programming in golang
Flow based programming in golangAnton Stepanenko
 
Help Needed!UNIX Shell and History Feature This project consists.pdf
Help Needed!UNIX Shell and History Feature This project consists.pdfHelp Needed!UNIX Shell and History Feature This project consists.pdf
Help Needed!UNIX Shell and History Feature This project consists.pdfmohdjakirfb
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPIAjit Nayak
 
Implementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresImplementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresGowtham Reddy
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsashukiller7
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical fileAnkit Dixit
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docxfelicidaddinwoodie
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealTzung-Bi Shih
 
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"LogeekNightUkraine
 

Similaire à Lab report 201001067_201001104 (20)

Os lab final
Os lab finalOs lab final
Os lab final
 
Linux_C_LabBasics.ppt
Linux_C_LabBasics.pptLinux_C_LabBasics.ppt
Linux_C_LabBasics.ppt
 
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfWrite a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Raspberry pi Part 6
Raspberry pi Part 6Raspberry pi Part 6
Raspberry pi Part 6
 
Activity 5
Activity 5Activity 5
Activity 5
 
Flow based programming in golang
Flow based programming in golangFlow based programming in golang
Flow based programming in golang
 
Help Needed!UNIX Shell and History Feature This project consists.pdf
Help Needed!UNIX Shell and History Feature This project consists.pdfHelp Needed!UNIX Shell and History Feature This project consists.pdf
Help Needed!UNIX Shell and History Feature This project consists.pdf
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
Implementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresImplementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphores
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
 
LP-Unit3.docx
LP-Unit3.docxLP-Unit3.docx
LP-Unit3.docx
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
 
Parallel computing(2)
Parallel computing(2)Parallel computing(2)
Parallel computing(2)
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
 
C++ basics
C++ basicsC++ basics
C++ basics
 
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
 

Dernier

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 

Dernier (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Lab report 201001067_201001104

  • 1. IT-215 System Software Project Report Submitted on: 16th April 2012 Simulation of manufacture of Sulphuric Acid Guided By: Prof. Sanjay Chaudhary Mentored By: Anadi Chaturvedi Submitted By: Prashant Pandey (201001067) Swena Gupta (201001104)
  • 2. Goal To simulate process automation for a manufacturing plant Problem Statement Assume that there is a manufacturing plant, which manufactures finished products based on processing on raw materials. There are few machines in the plant. Each machine inputs raw materials, performs processing and produces semi-finished product, which is supplied as input or raw material to another machine. Thus, there is a chain of machines which are involved in the process inputting raw materials or semi-finished product and produces semi- finished product. Finally finished product will be the final output. Each machine is to be simulated as a process. Various processes can be initiated independently of each other and executed in background. Each process may take input from a specific named pipe and write output as a processed semi- finished product on some other named pipe. Define the sequence of actions among 5-7 such machines, define the flow input and output among them. One machine should be identified as a machine, which generates finished product, i.e. gray cloth. Each machine operates under certain environmental conditions, i.e. machine should be operated within the range of temperature. If temperature level of any of the machine is more than the upper limit then it should 1
  • 3. generate signal and send it to the main controlling machine, which will inform all other machines to stop operations. Concepts Used • Multiple Threading • Mutual Exclusion and Condition Variables • Inter Process Communication using Pipes • Signal Handling and Processing • Accessing System time. Programming Language C Language inclusive of concepts of Shell Programming. used Tools used gcc compiler. Header Files Used 1) #include <stdio.h> This header file contains declarations used in most input and output and is typically included in all C programs. eg. printf() etc. 2) #include <stdlib.h> This header file contains Utility functions. eg. exit() etc. 2
  • 4. 3) # include <pthread.h> This header file defines the threads and its functions. eg. pthread_create() etc. 4) #include <signal.h> To catch the various signals implemented in our program, we have included <signal.h> because it contains sigaction as a structure. 5) #include <string.h> This header file contains String functions. eg. strlen() 6) #include <time.h> This header file contains implementation of date and time manipulation operations. Test Programs a) time_t now; time (&now); printf ("nn%snn", ctime (&now)); //the above code snippet has been used to access system time. b) act.sa_handler = catchint; sigfillset(&(act.sa_mask)); sigaction(SIGINT , &act, NULL); sigaction(SIGUSR1 , &act, NULL); void catchint(int signo) // handler for sigaction 3
  • 5. { if(signo==SIGINT) printf("nn'Ctrl+C' pressed...Interrupt generated and ignored!!!nn"); if(signo==SIGQUIT) . . . . } // The above code snippet is used to call signals at various activities of user such as pressing Ctrl+C to generate SIGINT etc. and to handle them using catchint function. c) if(pthread_create(&control_thread, NULL, control_machine, (void *) quantity)!=0) { printf("Failed to create a threadn"); exit(1); } pthread_join(control_thread, NULL); // The above part of program is used to create threads and to join them d) pipe (p); write (p[1], write_msg, 60); read(p[0], read_msg, 60); // the above statements are used to declare and do read-write operation on a named pipe. 4
  • 6. e) pthread_mutex_lock (&count_lock); while (taskid >= COUNT) { pthread_cond_wait (&count_cond, &count_lock); } pthread_cond_broadcast (&count_cond); pthread_mutex_unlock (&count_lock); //the above statements are used to put mutual exclusion amongst all the threads and to make all other threads wait while one thread is executing. Assumptions 1. The Initial & Favourable specifications of machines are pre-defined as stated in program (while we run the program, it displays on the console). 2. According to the code made by us, the specifications has been set, so that if the required amount is > 3 litres, all the 5 stage proccess machines gets overheated & production of 4th lts onwards acid needs to cool each machine. This has been shown appropriately while production of 4th litre and onwards acid production. 5
  • 7. 3. This has been done deliberately to introduce and show the concept of temperature in our machine automated manufacturing-plant system. 4. Following SIGNALS have been handled in our program a. SIGINT : signal called for handling Ctrl+C. b. SIGQUIT : signal called for handling Ctrl+ c. SIGALRM : signal called for production of next litre of acid. d. SIGWINCH: signal called when output terminal window size is changed. e. SIGTSTP : signal called for handling Ctrl+Z. f. SIGUSR1 : signal called if the user enters invalid input. List of Programs • final_manufacture.c Log Files • log_for_3_litres_prodn • log_for_6_litres_prodn • log_for_9_litres_prodn • log_for_wrong_user_input • log_with_all_signals_handled_6_litres 6