Susan Lincke-Salecker

Susan Lincke-Salecker

<p>Susan Lincke-Salecker Lab Report A</p><p>Lab Report A: Laughing Children</p><p>Introduction The purpose of this lab is to observe the differences between processes and threads in C+ + and Java programs. To accomplish this, a parent thread/process spawns child threads, which create continual output. The output should indicate how different threads/processes execute in Java or C++. </p><p>Method Three programs are compared that used Java threads, C++ Processes and C++ Threads. Each program parent generates three child threads or processes. Each thread/process generates a series of laughs (either “Ha” or “He” or “Ho” strings). Ten laughs are printed per line. When the parent or any of the children exit, an exit message is printed including the thread or process ID. </p><p>I expect to see text between the three children interspersed. To ensure that switches between threads and processes are observed, I will increase the number of laughs per child thread or process until this interspersion is observed.</p><p>All programs are provided in Appendix 1.</p><p>Results My tests gave the following results: </p><p><Can provide graphs and discuss graphs. Be sure to include all the description that led to the graph results. The following shows text description of results…></p><p>For Linux machines:  The interval for switching between threads and processes occurred by 500 laughs for Java programs, but required 10,000 laughs for C++ programs.</p><p>For Java Programs on Linux:  When the operating system did intersperse text, I noticed that when the transition occurred between threads/processes, the laugh lines were longer, followed by a single short line of 1 laugh.  The Java programs appeared to take turns during the transitions: Ha Ho Ha Ho  The Internal program output differs from the External program output by …</p><p>For C Threads Programs on Linux: …</p><p>For Java Programs on the Sun: Susan Lincke-Salecker Lab Report A  I noticed a pattern: Ho Ho Ha He He Ha Ho Ho</p><p>Analysis A ‘context switch’ occurs when the CPU switches between processes [1]. It appears obvious that the context switch and thread switching interval for Java is much shorter than for C++.</p><p>During the transition periods, it appears that the following is occurring…Errors are explained by ….</p><p>The Java internal and external program output differs because ….</p><p>On the Sun machine the Java thread scheduler appears to operate … (take a guess here)</p><p>Conclusion For this lab I developed and ran programs to test how the operating system schedules multiple child threads/processes in a single program. The lab demonstrated significant timing differences between Java and C++ context switch intervals. It demonstrated that output can vary from one run to another. …</p><p><This is the take-home message to the reader, that shows the importance of your lab results.></p><p>References [1] A Silberschatz, P Galvin, G Gagne, Applied Operating System Concepts, Windows XP Update, 1st Ed., 2003, John Wiley & Sons, p. 95.</p><p>Appendix 1A: Java Program Code</p><p>Appendix 1B: C++ Fork Program Code</p><p>Appendix 1C: C++ Threads Program Code</p><p>Appendix 2A: Excerpts of Java External Program</p><p>Appendix 2B: Excerpts of Java Internal Program</p><p>Appendix 2C: Excerpts of C++ Fork Program</p><p>Appendix 2D: Excerpts of C++ Thread Program</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us