tendency to go to sleep and, of course, will not cause an invalid wakeup problem.Let's take a look at examples from the Linux kernel to see how the Linux kernel avoids invalid sleep, this code is from Linux2.6 's kernel (linux-2.6.11/kernel/sched.c:4254): 4253/* Wait for Kthread _stop */4254 set_current_state (task_interruptible); 4255 while (!kthread_should_stop ()) {4256 schedule (); 4257 set_ Current_st
For wait and sleep it would seem to block threads, but they are really a big difference, so here's a little bit of discussion:
Difference one, Sleep () is the method inside the thread, and wait () is the method of the object class.This is relatively simple, directly read the code will know:
The difference between the sleep () method does not need to be a
The go language sleep sorting algorithm is described in this article. Share to everyone for your reference. The specific analysis is as follows:
The sleep sort algorithm was invented by a gifted programmer, the idea is very simple, that is, for the different numbers in the array to open multiple threads, each thread according to the size of the number of
Does sleep in Linux provide sleep and sleep in a common windows system. In Linux sleep, there are two ways to sleep: mem and standby. Sleep also has two ways: shutdown and platform. Each method is somewhat different.Before proceed
the synchronized function or synchronized block. If the call is made in the non-synchronized function or non-synchronized block, the illegalmonitorstateexception exception will occur at run time, although it can be compiled.3.yield methodPauses the currently executing thread object.Yield () simply returns the current thread back to the executable state, so the thread executing yield () is likely to be executed immediately after entering the executable state.Yield () only causes threads with the
Alarm,select,sleep functionThe kernel needs to do time management:1) provides the tick interrupt used by the system scheduler2) Maintenance System time3) Maintenance of software timers, high-speed TCP and multimedia applications to make the timer efficient and accurateIn order to better support the demand of audio and video, this paper puts forward the high precision clock subsystem of Hrtimer, and uses the tickless subsystem in order to save energy.T
, determine which one corresponds to your hard disk (usually 0 \: 0 \: 0 \: 0 ).
2, chmod + x S00hdd-shutdown-workaround at this time shutdown abnormal sound has been resolved
3. Shut down or sleep Linux and cp the file to "/ect/init. d/hdd-shutdown-workaround"
4. Establish a connection# Ln-s/etc/init. d/hdd-shutdown-workaround/etc/rcS. d/S99hdd-shutdown-workaround of course, you need to first su get permissions at this time shutdown and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.