what will happen if two threads of different priority values to run simultaneously
Answers
First, the whole reason you use a lock, is to deal with this exact circumstance. Second, since you have placed Operating Systems: in front of your question, I think it's misleading people. All you are asking about is the acquisition of the lock. And I will assume it's an open lock at the time both threads call the OS to acquire it. The differences between OS's, and lock/semaphore types happen mainly when you don't acquire the lock.
In general, the simplest answer on all OS's is the thread whose atomic CAS instruction got access to the bus first, this thread will get the lock. In fact, on Intel you LOCK the bus, with the LOCK prefix, and then perform CMPXCHG.
Do mark brainliest
Throughout multi-threaded program execution, several core system threads can run simultaneously, or in parallel, as various threads can be split into separate cores to share the workload.
Explanation:
- Many threads can be run on a 'single-core microprocessor device', but not in parallel.
- While conceptually 'threads' are often said to 'run at the same time', 'they actually run consecutively' in 'time slices allocated' and 'managed by the operating system'.
To know more
Difference between multicore processor and single core processor
https://brainly.in/question/2416405
What are the most common multiple core processors?
https://brainly.in/question/1943079