Sponsored Content
Full Discussion: Atomicity
Top Forums Programming Atomicity Post 50910 by jim mcnamara on Wednesday 5th of May 2004 10:36:02 AM
Old 05-05-2004
If you mean 'will the entire if statement be evaluated atomically'
-- the answer is No. It cannot be guaranteed.

Once the quantum expires (your timeslice is used up), some other process can pre-empt the processor. Assuming I understood your question correctly.
 
timeslice(5)							File Formats Manual						      timeslice(5)

NAME
timeslice - scheduling interval in clock ticks per second VALUES
Failsafe Where defines the number of clock ticks per second for which the system is configured. Default Where is equal to Allowed values Any value in the range of is allowed. A value of indicates no timeslice based scheduling preemption, and threads will continue to run until they voluntarily switch out or higher priority threads preempt them. Recommended values Use the default value in normal cases. In special cases where quicker round robin scheduling is required, a value of may be used. How- ever, a change in value may have a direct impact on system performance. Customers must evaluate performance impact in their workload envi- ronment before changing the value on production systems. DESCRIPTION
The tunable defines the scheduling time interval that a thread may execute on a processor before the kernel scheduler will context switch out the thread for other same priority threads to run. When a thread starts executing on a processor, the thread is set up to run for the number of ticks in the tunable. On every clock interrupt that a thread is found executing, the time quantum balance for the thread is decremented, and when the balance reaches zero, the thread is context switched out. The value controls one method of user preemption that the operating system implements. A larger value will reduce preemption of running threads; however, there are other reasons for user preemption of threads, and the tunable has no control there. A change in the value may have direct impact on system throughput and response times. A very small value may result in too many context switches, and a very large value may result in the starvation of runnable threads. Who Is Expected to Change This Tunable? Anyone. Restrictions on Changing Changes to this tunable take effect at the next reboot. When Should the Value of This Tunable Be Raised? Since the tunable is globally applicable to all threads (except in the system, irrespective of their scheduling policies and priorities. Any increase in value of this tunable will give equal time quantum boost to all threads. If the system has too many context switches due to preemptions, caused by higher priority threads, you can raise the value to provide more time for lower priority threads to execute when they get scheduled, because higher priority threads will preempt the lower priority threads when they become runnable. What Are the Side Effects of Raising the Value? Raising the value of the tunable may cause starvation of some threads, as they have to wait longer for their turn to execute. This may cause performance throughput issues. When Should the Value of This Tunable Be Lowered? The tunable value should be lowered if better turnaround in response time is required at the cost of additional context switches. When the system does not have too many compute intensive applications, threads will block and preempt much more frequently without utilizing their complete time quantum. What Are the Side Effects of Lowering the Value? The lowering of the tunable will result in many more context switches which will increase the time spent in SYSTEM space and less time spent in USER space. Also, the applications that are compute intensive will suffer performance degradation. What Other Tunable Values Should Be Changed at the Same Time? None. WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. Tunable Kernel Parameters timeslice(5)
All times are GMT -4. The time now is 07:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy