1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MrMuchimi
2 years ago
11

Write a Java program that launches 1000 threads. Each thread adds 1 to a variable sum that initially is 0. You need to pass sum

by reference to each thread. In order to pass it by reference, define an Integer wrapper object to hold sum. Run the program with and without synchronization to see its effect.
Computers and Technology
1 answer:
vlabodo [156]2 years ago
6 0
Java is a 3D mental breakdown in the sim game and he has to play the game and play it with the same thing he has been doing wrong and he is a queen and he is
You might be interested in
A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always a
mestny [16]

Answer:

Swap codes in line 7 and 8

Explanation:

The code segment below

Line 1: count ← 0

Line 2: sum ← 0

Line 3: FOR EACH value IN numbers

Line 4: {

Line 5: count ← count + 1

Line 6: sum ← sum + value

Line 7: average ← sum / count

Line 8: }

Line 9: DISPLAY (average)

The above code will make the program translator calculate the average value at each iteration.

This will take a longer time to execute and also means more instructions for the program translator.

Swapping line 7 and 8 will reduce the number of instructions to execute. This will have an instant effect on the time taken to execute the program.

Swapping line 7 and 8 means that, the program translator will only calculate the average after it must have finished calculating the sum of the values in the iteration statement.

3 0
3 years ago
Discuss how a lack of infrastructure in poor communities could contribute to ill-health such as the Unrest looting.​
shutvik [7]

Answer:No service from hospital for injured people

Explanation:

Yes of course

4 0
2 years ago
________ was one of the first uses of the Internet
NeTakaya

Government weapon in cold war

3 0
3 years ago
Read 2 more answers
Write a shell (text-based) program, called sum_second.py, that opens a text file called stuff.txt with 2 numbers per line separa
Ivanshal [37]

Answer:

See explaination for the program code

Explanation:

The Programming code:

inFile = open("stuff.txt", "r")

num = []

Sum = 0

for val in inFile.readlines():

value = val.split(",")

Sum = Sum + int(value[1])

print("Sum of second number on every line in the file is: ", Sum)

inFile.close()

Please kindly check attachment for output

6 0
3 years ago
You work in a classified environment where Bell LaPadula MLS (Multilevel Security) model is employed. Your clearance is "SECRET"
kumpel [21]

Answer:

The answer is by using a covert channel like shared memory objects such as files, directories,messages, etc since both  the user and the sender of the document are on same network of the company.

Explanation:

The Bell LaPadula MultiLevel Security model was a security policy developed by Bell and LaPadula in 1973 in response to a security issue raised by the US Air Force regarding file-sharing mainframe computers . Actually, many people with networked systems have realized by early 1970s that the protection purportedly offered by many commercial operating systems was poor, and wa not getting better any time soon. This was observed when it was noticed that as one operating system error was fixed, some other vulnerability would be discovered. There was also the constant worry that various unskilled users would discover loopholes in the operating system during usage and use them to their own advantage.

 Information release may take place via shared memory objects such as files, directories, messages, and so on. Thus, a Trojan Horse acting on behalf of a user could release user-private information using legitimate operating system requests. Although developers can build various mechanisms within an operating system to restrict the activity of programs (and Trojan Horses) operating on behalf of a user  , there is no general way, short of implementing nondiscretionary policy models, to restrict the activity of such programs. Thus, given that discretionary models cannot prevent the release of sensitive information through legitimate program activity, it is not meaningful to consider how these programs might release information illicitly by using covert channels.

For example, for someone with higher integrity level (SECRET) to send an accounts payable application to a user, if the untrusted accounts payable application contains a Trojan Horse, the Trojan Horse program could send a (legal) message to the said user process running at a lower integrity level (CONFIDENTIAL), thereby initiating the use of a covert channel. In this covert channel, the Trojan Horse is the receiver of (illegal) lower integrity-level input and the user process is the sender of this input.

7 0
3 years ago
Other questions:
  • you are a software engineering consultant and have been called in by the vice president of finance of a corporation that manufac
    10·1 answer
  • A ____ document identifies the purpose of the program being developed, the application title, the procedures to be followed when
    11·1 answer
  • Suppose you find a magic $1.00 coin. Its magic power is as follows: as each day passes, you get an additional dollar plus half o
    6·1 answer
  • Suppose arraylist list1 is [1, 2, 5] and arraylist list2 is [2, 3, 6]. after list1.addall(list2), list1 is __________.
    8·1 answer
  • A financially stable person is able to
    12·2 answers
  • What does it mean to be self demanding?
    12·1 answer
  • Create a program that generates a report that displays a list of students, classes they are enrolled in and the professor who te
    11·1 answer
  • . What is the difference between a combinational circuit and sequential circuit? Give example of each.
    8·1 answer
  • Why must you be careful when handling a hard drive?
    10·1 answer
  • Which finger is used to press SHIFT key while typing!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!