There is some data related to temperatures of different cities. One side(thread), will be updating the values and multiple clients will be reading the values. how do you achieve synchronization?

Answer Posted / mskumar

My Answer was:-

Thread updating the data:- Should acquire the MUTEX lock and update the data & release the MUTEX.

While threads try to read the Data :- Should acquire the lock such that only read access allowed during the lock, not the write lock so that any no.of clients trying to read can read at the same time.

Can some give me thier thoughts if any?

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are device drivers?

605


How do I copy a path to a shared drive?

568


What is semaphore and its function?

535


How many types of file systems are there?

545


Can you please explain the difference between demand-paging and pre-paging?

595






What is the meaning of busy spin in multi-threading?

582


What is the cpu scheduler?

536


Difference between logical and physical address space?

578


Can I have two operating systems on one computer?

538


Which JVM parameter is used to control the stack size of a thread?

540


Explain briefly about assembler and its functioning?

563


What is the difference between logical address space and physical address space?

550


Difference between a thread and process?

664


What is the difference between ie and edge?

523


Explain the difference between logical & physical address.

615