Some people explain the difference between a thread and a process in this way: 2
Thread: minimum unit of Resource Competition2.
Process: minimum unit of Resource AllocationFrom the perspective of resource management, threads and processes are well
Macro definition containing if
When the macro definition contains if
1) define the following macro# Define DC (p) if (foo (p) fun (p)
Used in the following Environment
If (k> n)
DC (k );
Else
DC (n );
After macro replacement
If (k> n)
If
I. Use of variable data:
# Ifdef debug# Define debug_printf (STR,...) do {printf (STR, _ va_args _);} while (0)# Else# Define debug_printf (STR ,...)# Endif
Depends on_ Va_args __, Which can be used happily.Debug_printf ().
Ii.
Linux 2.6 interrupt mechanism analysis
Author: meteor
SummaryThis article mainly analyzes softirq, tasklet, and workqueue in the lower half of Linux 2.6 kernel from the perspective of users. The specific implementation of these three mechanisms in
How to Use Macros in C language, including Single and Double Well variable parameters
Favorites
Macros (macro) in C (and C ++) belong to the scope of compiler preprocessing, and belong to the concept of compilation period (rather than the concept of
Since I got in touch with my computer, I have never been able to get up early or get up early. I have written a small software program to manage my computer these two days, and I will automatically shut down my computer at the specified time, as to
Last Updated: 2011/04/02
1. Use the list to achieve a specific segment value after getting explode:
List (, $mid) = explode ('; ', $string);
2. Use NULL = = to replace Is_null:
Is_null and NULL = = are exactly the same effect, but save a function
Event-driven Framework (v)-implementation of the framework
Description
Here first describe some of the QP strategy and source code.For some reason this series first stops more. The following is mainly about the kernel. Implement 1. Critical
My development leader once said such a paragraph "a good programmer is not how fast he writes the code, nor is he able to implement the function of the module, to realize the function of the business who will not ah, the important thing is his
Each process has two independent status flags:Task->state: Is the runnability of the relationship process;Task->exit_state: is about task exiting;#define TASK_RUNNING 0#define TASK_INTERRUPTIBLE 1#define Task_uniterruptible 2#define __TASK_STOPPED 4#
Text: Step by step writing algorithm (stair climbing)"Disclaimer: Copyright, welcome reprint, please do not use for commercial purposes. Contact mailbox: feixiaoxing @163.com "The first two days on the internet when you see a particularly
The focus of this article is to avoid invalid wake-up of kernel threads and focus primarily on the design of consumer threads.Therefore, in order to save trouble, here and the producers, consumers themselves, the processing process may not be
Principle:
Cocos2d has a director to control the whole game process, the director will add the scene to the screen, the scene has a variety of actors.
First by showing a picture to see the cocos2d game process:
AppDelegate.cpp
BOOL Appdelegate::
First, Introduction
Balanced binary tree (balancedbinary or height-balanced)
Also known as the AVL tree. It is either an empty tree or a two-fork tree with the following properties: Its Saozi right subtree is a balanced binary tree, and the Saozi
List of the general to be initialized, insert, delete, display, release linked list, look for the nodes of these operations, the following I have a brief introduction to these operations, because my ability is not enough, there may be some things to
#define MY_LOG (level, FMT, args ...) do{ if (bit_on (Debug_flag,level)) { printf ("[%s]:", __function__); printf (FMT, # #args); } } while (0)Of course we also need to define a set of debug level methods, my idea is this:
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.