IntroductionLet's look at the following two semaphores: Sigpipe when the pipe reads off and then writes to the pipe, the sigpipe signal is emitted.SIGCHLD Child process exit will send a SIGCHLD signal to the parent process, the system default processing is to ignore the signalCode/************************************************************************* > File name:my_fork.c > Author: Krischou > Mail:[email protected] > Created Time:mon-10:42:26 AM CST *************************** ***************
The visitor pattern is the behavior pattern of the object. The purpose of the visitor pattern is to encapsulate some operations that are applied to a data structure element. Once these operations need to be modified, the data structure that accepts the operation can remain intact.Concept of the assignment The type of the variable being declared is called the static type of the variable, and some people call the static type the explicit type (apparent type), whereas the real type of the object r
)The function returns the total number of Operation file descriptors corresponding to the response operation, and the three groups of data are modified at the appropriate position. Only some of the response operations are not modified. Then we should use the fd_isset macro to find the returned file descriptor group.
Here is a simple example of testing the readability of a single file descriptor:
Int isready (int fd){Int RC;Fd_set FDS;Struct timeval TV
clear the specified fd_set, then call the macro fd_set to add the FD to be tested to fd_set, and then call the select function to test all FD in fd_set, finally, use the macro fd_isset to check whether the corresponding bit is still 1 after a FD is called by the Select function.
The following is an example of testing the readability of descriptive words in a single file:Int isready (int fd){Int RC;Fd_set FDS;Struct Tim TV;Fd_zero (
a single file:
Int isready (int fd)
{
Int RC;
Fd_set FDS;
Struct Tim TV;
Fd_zero ( FDs );
Fd_set (FD, FDs );
TV. TV _sec = TV. TV _usec = 0;
Rc = select (FD + 1, FDS, null, null, TV );
If (RC
Return-1;
Return fd_isset (FD, FDs )? 1: 0;
}
The following is a complex appl
Problem: Using Python to match strings between two strings in a regular wayWorkaround: Using the FindAll of the RE module, note that Re.match is only matched from the beginningMethod:Import''= Re.findall (R'', html_str)print(local[0]) #' var, FDS, FDS, FDs FDS, FDS
About main Dispatch queue and global Dispatch queue.The previous article said the way to create a Dispatch queue, in fact, without the dispatch_queue_create function can also get Dispatch queue, which is the main Dispatch queue and Global
Welcome into the coding world of summer.Today's shared knowledge of GCD, GCD's note: What developers need to do is define the tasks they want to perform and go home to the appropriate dispatch queue.There are two types of dispatch the Queue see the following table
Types of Dispatch queue
Description
Serial
Record the usage of several important APIs for GCD.Dispatch_queue_create*stringis** * * * * * The newly created Dispatch queue.dispatch_queue_tdispatch_queue_create (constchar *label, Dispatch_queue_ attr_t attr);Used to create the dispatch Queue, the return value type is dispatch_queue_t, this method needs to pass two parameters, label is a string tag attached to the queue, this parameter is optional, and
as the data is ready in the horizontal trigger.[Plain]View Plaincopy
[Email protected]:~/station$./t_select
Ni hao ma, wo hen hao A, ni ne???
Ni hao Ma
, Wo Hen
Hao A, ni
Ne???
^c
[CPP]View Plaincopy
/*************************************************************************
> File name:demo_sigio.c
> Author:liuxingen
> Mail: [email protected]
> Created time:2014 August 14 Thursday 21:32 03 seconds
*****************************************
Prior to doing a few years of Windows C + + development, Linux under the experience is not rich, causing me to look at the QEMU code, some places also need to go back to learn the Linux operating system implementation mechanism to more accurate understanding. Learning the Linux operating system in general to read a lot of books, it seems to understand, but to understand deeply, with this mediocre IQ I think it is more to see Code multi-code code. Gossip less, look at a function in the os-posix.c
look at the functions one by one.?
0102030405060708091011
int kbhit(){struct timeval tv;fd_set fds;tv.tv_sec = 0;tv.tv_usec = 0;FD_ZERO(fds);FD_SET(STDIN_FILENO, fds); //STDIN_FILENO is 0select(STDIN_FILENO+1, fds, NULL, NULL, tv);return FD_ISSET(STDIN_FILENO, fds
In the past few days, the company has a project that needs to process word in the Java environment. I searched for it online. There are two main methods: Jakarta poi and Jacob (I .e: java com Bridge), I used the second method, combined
VBA, which is easy to use and powerful. The following is a record of your own experience. (First, copy the downloaded file Jacob. DLL to the C:/Windows/system32 directory, and add Jacob. jar to classpath.
.)
1. To obtain a Component Attribute, call the get method
dependent on the specific hardware of the interrupt triggering method. This method is the way that the user-state Gpio is converted to the interrupt pinActive_low not understand, also wood useful too(3)/SYS/CLASS/GPIO/GPIOCHIPNGPIOCHIPN represents a gpio_chip, a controller that manages and controls a set of Gpio ports in which a subordinate file exists:Base and N are the same, representing the smallest port number managed by the controller.lable Diagnostic use of flags (not always unique)Ngpio
Temporary table | string declare @str1 varchar (MB), @str2 varchar (m), @str3 varchar (MB), @str varchar (500)
Set @str1 = ' AADA,BBBF,CCC, '
Set @str2 = ' DDD,AAAAAA,FDSA '
Set @str3 = ' vvvvvv,aaabbbb '
Set @str = ' Fds,bbbf,eee,ddd,fff,hhhfg,dddde '
Right now:
Split the @str1 into AADA,BBBF,CCC three elements, where BBBF appeared in @str.
Split the @str2 into DDD,AAAAAA,FDSA three elements, in which DDD also appeared in @str.
Split the @str3 into V
-time processes through the pull_rt_task and push_rt_task two functions:Pull_rt_task-Pull the real-time process from the other CPU's run_queue into the run_queue of the current CPU. The real-time process being pull comes up with the following conditions:1, the process is the second highest priority in the Run_queue (the highest priority process must be running, do not need to move);2, the priority of the process is higher than the current run_queue in the highest priority process;3, the process
store FD in the select monitoring set,
First, it is used to judge fd_isset as the source data and fd_set after the return of select.
Second, after the SELECT statement is returned, the previously added but no event occurs in FD will be cleared, and the FD will be re-obtained from the array one by one before each start of the SELECT statement (fd_zero first ),
Scans the array and obtains the maximum FD value maxfd, which is used as the first parameter of select.
(4) it can be seen that the sele
Int maxfdp;Fd_set FDS;Struct timeval timeout = {1, 0}; // set select to wait 3 seconds and 3 seconds for polling. If it is not blocked, set it to 0.While (1){Sendto (SKT, sendline, sizeof (vip_hdr) + 100, 0, (Sa *) saddr, sizeof (SA ));Fd_zero ( FDs); // clear the set for each loop. Otherwise, the descriptor changes cannot be detected.Fd_set (SKT, FDs); // Add D
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.