[pooling technology] thread pool technology principle and C language implementation
1, Basic concepts
Before talking about thread pool technology, we first explain some basic concepts in the operating system, such as process, thread, thread creation and destruction.
Processes and threads
process An application running in memory. Each process has its own independent memory space. A process can have multiple threads. For ...
Added by driverdave on Sun, 12 Dec 2021 17:13:29 +0200
C language programming Report
preface
Design topic
C language game - Millionaire (simple version)
Novice Xiaobai, I hope you can make more suggestions and make progress together
1, Adopted data storage structure and its meaning
Input: judge whether to play the game
num1,num2,
a1,a2: the position on the chessboard corresponding to the cumulative number of dice rol ...
Added by toffler on Sun, 12 Dec 2021 11:24:21 +0200
Greedy snake -- [pure C implementation] -- [step-by-step explanation] -- [music]
catalogue
1, Game Description
1.1 game key description
1.2 scoring system
2, Game running
2.1 game effect display
2.2 correction of an error
2.3 game code
3, Game framework construction
3.1 size of game interface
3.2 snake head and body
3.2. 1 snakehead
3.2. 2 snake body
3.3 marking the game area
3.3. 1 what are the locations wher ...
Added by pyfsapple on Sun, 12 Dec 2021 02:05:07 +0200
C language data structure - sequence table
Sequence table:
Creation of sequence table:
Define structure: the structure member contains an integer array and an integer variable that records the last data subscript:
#define DATASIZE 5
typedef struct
{
int data[DATASIZE];
int last;
}sqlist_t;
Write a function to create a sequence table: return the first address of the sequence table ...
Added by Hellomonkey on Sat, 11 Dec 2021 10:05:39 +0200
Array arrangement of C language experiment course
It's really hard. Take notes.
[10 points] A. experiment 7-1-1 simplified insertion sorting Title Description
This problem requires writing a program to insert a given integer into the original ordered integer sequence, so that the result sequence is still orderly.
input
Input the non negative integer N (< = 10) in the first line; The sec ...
Added by Janco on Sat, 11 Dec 2021 07:23:16 +0200
Study notes for week 5
About stack: similar to later, it is processed first
Judge whether it is a palindrome string according to the example from AHA algorithm stack:
#include<stdio.h>
#include<string.h>
int main()
{
char a[101],s[101];
int i,l,m,next,top=0;
gets(a);
l=strlen (a);
m=l/2-1;
for(i=0;i<=m;i++)
s[++top]=a[i];
if(l=a%2==0)
...
Added by bruceleejr on Sat, 11 Dec 2021 06:12:55 +0200
Advanced C language uses qsort to complete the explanation of general sorting (with the explanation of qsort principle and the method of writing qsort by yourself) (completed by callback function)
catalogue
1. Introduction to qsort function
2. Application of qsort function
3. How to write qsort function
1. Introduction to qsort function
First, a detailed explanation of qsort function on msdn is attached
void qsort(void* base,
size_t num, //Number of elements to be sorted
size_t width, //The size of an e ...
Added by phpyoungdeveloper on Fri, 10 Dec 2021 17:16:22 +0200
Understanding C language learning from assembly II: Examples
1, C language code block
#include <iostream>
#include <stdio.h>
int ftrl(int n)
{
if (n == 1) {
// ne1
return 1; // ne2
} // ne3
int pre = ftrl(n - 1); // ne4
return pre * n; // ne5
}
void main()
{
int a = 3, b; // ne1
b = ftrl(a); // ne2
printf("b: %d\n", b); // ne3
}
2, Process
2.1 put main on the stack ...
Added by charlie2869 on Fri, 10 Dec 2021 13:47:51 +0200
Article to understand what is websocket protocol (with C implementation program under linux)
websocket background
1.websocket protocol was born after HTTP protocol. Before the emergence of websocket protocol, it was found that creating web applications that require two-way communication between the client and the server (for example, instant messaging and game applications) needed to abuse HTTP to poll the server for updates, which wo ...
Added by khaine on Thu, 09 Dec 2021 15:25:44 +0200
[C language] implementation of N-sub chess game
Today, I will play a small game of N-sub chess, which can be realized from 3x3,4x4 to NxN
Requirements: be able to play chess according to the input coordinates and judge whether to win or lose
First write out the general framework of the main function:
int main()
{
int input = 0;
srand((unsigned)time(NULL));
do
{
menu();
printf("P ...
Added by davidjmorin on Thu, 09 Dec 2021 14:02:08 +0200