Design a java "hello world" program

Assignment Help Operating System
Reference no: EM13944880

Design a Java "Hello World" program that should mimic distributed processing of printing the string "Hello World!" on display.

For doing this the main() method should just create 5 threads and store references to them in an array of threads, which will be passed to each thread for communication purposes. Then the main() method should start all threads, wait for their completion and exit. It must not control the threads in any way or send any other information to them.

Each thread will compete for the display access and once it is granted, the thread prints out only one character of the string (namely the next one in order) and then starts to compete for the display access again for printing the next character. If all characters of the string are printed, the thread exits. This way each of the threads will execute the same algorithm and print just a few string characters.

Printing a string character can be considered as a critical part of the thread code. For this, implement a mechanism providing mutual exclusion, but without using any synchronization approaches (semaphores, locks, etc.). Each of the threads should be able to communicate with other threads by sending messages to them. The communication must be purely distributed in the sense that no other shared object is available to threads besides of the Thread array workers.

Reference no: EM13944880

Questions Cloud

Which is better for the is manager to employ and why : Which is better for the IS manager to employ and why?
State of the kid : A USA Today Snapshot summarized the results of a 'State of the Kid' survey conducted by the Highlights magazine.  A total of 500 children were surveyed, 200 were considered young kids (with ages 9-10 years old) and 300 were older (with ages 11-14 yea..
A light, inextensible cord passes over a light : A light, inextensible cord passes over a light, frictionless pulley with a radius of 4.2 cm. It has a(n) 19 kg mass on the left and a(n) 5.3 kg mass on the right, both hanging freely. Initially their center of masses are a vertical distance 4.4 m ..
How are each of the theories similar : How is learning defined and/or described by each of these theories? How are each of the theories similar? How do they differ?
Design a java "hello world" program : Printing a string character can be considered as a critical part of the thread code. For this, implement a mechanism providing mutual exclusion, but without using any synchronization approaches (semaphores, locks, etc.).
Advantages of using a sample to represent the population : A brief description of the media example you found, including details about the sample. What population do you believe this sample best represents? What are the advantages and disadvantages of using a sample to represent the population in your par..
Best understanding of the physical universe : Welcome to PHYS 151, "Mechanics and Heat." In this class we will explore the foundations of modern mechanics from the point of view of our current, best understanding of the physical universe.
Engage with stakeholders to initially brainstorm : You will need to engage with stakeholders to initially brainstorm some solutions that address the causes of the problem.
Justification for using the approximate model : Show all work, including justification for using the approximate model to find this probability. You may upload a picture as part of your supporting work if you wish.

Reviews

Write a Review

Operating System Questions & Answers

  Give four asymptotically different functions

Give four asymptotically different functions which are both in ?(1) and o(n).

  Use of ntfs permissions for the folders or files on network

Justify the use of NTFS permissions for the folders / files on the network and explain the top two to three (2-3) reasons this is the most reliable option at the business unit leaders' disposal

  Pros and cons of using embedded uid and pw

Think about an embedded user id and password which provides me access to a client/server environment. Discuss the pros and cons of using an embedded uid and pw?

  Specify the order in which processes execute

Specify the order in which processes execute and determine the mean process turnaround time for each of the scheduling algorithms.

  What is a user friendly text editor

What is a user friendly text editor which comes pre-installed in Mint that can be used directly in the terminal?

  What conclusion can you draw about disk block size

On the other hand, the largest 10 percent of all files usually occupies about 95 percent of the entire disk space in use. From this data, what conclusion can you draw about disk block size?

  Questions about on ssl

Provide a table showing the Caesar cipher with a key five, and then provide the result of applying this cipher to the text 'I came I saw I conquered'.

  Lanen corporation is a major imaging solutions provider the

lanen corporation is a major imaging solutions provider. the company has three main divisions one that manufactures

  Describe the windows kernel

Describe the Windows kernel, including its two main components.

  Analyze concepts of cryptography

You have been asked through the Training Manager to present a lunch and learn seminar on an area within your field of expertise. You select cryptography.

  Find the sizes of the tag, block and word fields

Assume that a computer using direct mapped cache has 2^24 words of main memory and a cache of sixty-four blocks, where each cache block contains sixteen words.

  Differences between olap and oltp

Business intelligence systems are sometimes called online analytical processing systems. These online analytical processing systems are used to make decisions and are characterized

Free Assignment Quote

Assured A++ Grade

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

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