[issue 15] talk about these common multi-threaded interview questions
How many different ways do you create threads? Which one do you like? Why?
There are three ways to create threads:
Inherit Thread class
Implement Runnable interface
Applications can use the Executor framework to create thread pools
Implementing the Runnable interface is more popular because it does not need to inherit the Thread class. ...
Posted by dannybrazil on Sat, 27 Nov 2021 19:48:45 -0800
Nanjing University of Posts and telecommunications operating system experiment 4: simple file system simulation experiment
Experiment purpose and requirements
Understand the file system composition and basic principle of the operating system, use these knowledge to simulate a FAT file system in memory, complete the file creation and indexing functions, and realize the following command interfaces:
(1) New file, format: ...
Posted by DapperDanMan on Sat, 27 Nov 2021 19:45:00 -0800
RedisTemplate switches Jedis implementations and common Jedis API s
catalogue
RedisTemplate switch Jedis implementation
Switch the underlying Jedis API operation Redis
RedisTemplate switch Jedis implementation
1. Spring Boot is Lettuce and Jedis The client library provides basic automatic configuration. By default, it is used Lettuce As a client, if you want to switch the Jedis client, there are two steps: ...
Posted by eldee on Sat, 27 Nov 2021 19:42:55 -0800
Experiment 2 of operating system of Nanjing University of Posts and Telecommunications: mutual exclusion and synchronization of threads
Experimental principle and content
Critical area management based on mutual exclusion
Using the editor gedit 2_1.c, create a new 2_1.c source file, create two threads to complete the ticket booking operation concurrently, and enter the following example code:
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
int ti ...
Posted by SalientAnimal on Sat, 27 Nov 2021 19:33:26 -0800
It's possible to create endless images with words. Dale's pre training model starts
It is possible to create endless images with words. The Russian version of Dall-E pre training model starts
(including automatic translation, Chinese can be entered)
Look, look, this dalle is really wonderful. Write what you read and draw what you think.
Don't miss your brain hole.
"Avocado chair"
"Beau ...
Posted by thatsme on Sat, 27 Nov 2021 19:20:51 -0800
Chapter II overview of C language
Chapter II overview of C language
1. Simple C program example
cat first.c
#include <stdio.h>
int main(void)
{
int num;
num = 1;
printf("I am a simple ");
printf("Computer. \n");
printf("My favorite number is %d besause it is first.\n",num);
return 0;
}
Compilation execution:
[root@hans ~]# gcc -o first fir ...
Posted by zingbats on Sat, 27 Nov 2021 19:10:10 -0800
PHP post sends and receives data
PHP Send POST data
$data = '{
"id": "17999030",
"method": "sayHello",
"jsonrpc": "2.0",
"params":
{
"acmac": "00E0614CA7C6",
"acconf_version": "2015-10-28-09-45"
}
}';
$url = "http://wifi.doucube.com/index.php/interface/device/ConfHeartbeat.html";
$res = http_request($url, $d ...
Posted by contex on Sat, 27 Nov 2021 19:06:02 -0800
Statistical leaf node 21
1, Title Description
Description
The preorder traversal and inorder traversal of a binary tree are given, and the number of leaf nodes of the corresponding binary tree is counted. This question requires the use of a binary linked list, otherwise even if it passes, points will be deducted as appropriate.
Input
Input two lines of string compo ...
Posted by freelancedeve on Sat, 27 Nov 2021 18:56:45 -0800
React's Effect Hook solves performance problems and potential bug s of function components!
1, What is Effect Hook?Hook is a special function starting with use, which allows the function component to have some features of the calss component. Effect Hook refers to the special function useEffect, which allows function components to perform custom operations after rendering. useState should be used with caution in useEffect, because it ...
Posted by Irresistable on Sat, 27 Nov 2021 18:38:21 -0800
JAVA thread safety issues
In the process of selling tickets, there are thread safety problems, including duplicate tickets and wrong tickets.
Why is this problem?
When a thread has not completed the ticket selling operation during the operation of ticket selling, and other threads also participate in the operation of ticket selling, thread safety problems will occur ...
Posted by hustler on Sat, 27 Nov 2021 18:12:12 -0800