In Linux, modify the environment variable PS1 (command line prompt), you can use VI to edit the/etc/profile file, and add the following at the end:
Export PS1 = '[/u @/h/W]/$'
You can, where/u shows the current user account,/h shows the current
#0-stop (do not set initdefault to 0)#1-single-user mode#2-multiple users, but no NFS#3-full multi-user mode#4-useless#5-X11#6-Restart (do not set initdefault to 6)# Detailed explanation of each running level:0 indicates that the machine is shut
The following describes the splice function of the list function in Linux:
1. Static inline void _ list_splice (struct list_head * List,
Struct list_head * head)
{
Struct list_head * First = List-> next;
Struct list_head * Last = List-> Prev;
Struct
The following describes the key function container_of in list:
/**
* List_entry-get the struct for this entry
* @ PTR: The & struct list_head pointer.
* @ Type: the type of the struct this is embedded in.
* @ Member: the name of the list_struct
FIFO is a common saying: first in first out, first in first out, is the Data Processing Form of queues in the data structure.
What we want to talk about here is also called the named pipe, which is a way of inter-process communication.
1. concept:
In essence, mutex is a lock that provides protection for access to shared resources.
1. Initialization:
In Linux, the thread mutex data type is pthread_mutex_t. Before use, initialize it:
For the mutex of static allocation, you can set it to pthread_
1. concept:
A thread is different from a process. To be precise, a process can be composed of multiple threads. A thread is an element of a process. by default, a process is composed of only one thread, which serializes the tasks to be executed by
The sigaction function is used to check/modify the processing action associated with the specified signal. in earlier versions of UNIX, signal was used. Later, sigaction was used. It can be seen that signal is more powerful than signal. in addition,
As mentioned in the first article of the thread synchronization series, read/write locks can have higher concurrency because they have three statuses.
1. features:
Only one thread can occupy the read/write lock in the write mode at a time, but
In the previous article, we used semaphores to achieve mutual exclusion between threads. This article uses the mutex synchronization mechanism of semaphores to implement a classic instance, that is, "producer and consumer ".
1. Briefly describe the
In the previous article, we talked about the use of mutex locks in threads to achieve mutex usage of shared resources. In addition to mutex lock, semaphores, the PV primitive mentioned in the operating system, can achieve mutex and synchronization.
Tar
-C: Create a compressed file-X: Extract-T: View content-R: append an object to the end of the compressed archive object-U: update files in the original compressed package
These five are independent commands, one of which must be used for
As mentioned in the previous article, multiple threads in a process share the same resource and lead to a lock due to thread competition. Here, mutex is a simple locking method. This mutex has only two States: locking and unlocking. You can regard
I recently saw a good guide on Linux kernel entry abroad, so I tried to translate it. Because it is the first time to try translation, and the English level is limited, errors are inevitable. Thank you!
Since there is no time for this, it is
"Helloworld DRIVER: loading and detaching drivers in kernel space
When a device driver module is loaded into the kernel, preparations such as resetting devices, reserved RAM (reserving RAM), interruptions, and input/output ports are often
Install and configure ndk in Linux
If you need to reuse some of the previous C language programs when writing Android programs, you can consider using ndk. Since C and C ++ programming are designed, we strongly recommend that you install the eclipse
Tar [-cxtzjvfppn] file and directory ....
Parameter:-C: Create a compressed file parameter command (create meaning)-X: unlock a compressed file parameter command-T: view files in the tarfile special attention, under the parameter, only one C/X/T
The path value is a series of directories. When you run a program, Linux searches for these directories. Run the following command to view the value of path.
$ Echo $ path
For example, in the host, the path value of your Yogin is:
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service