线程池的作用 在多线程的应用中,线程的频繁创建和销毁会浪费时间,从而影响效率,所以引进线程池和概念,将多个线程维护在线程池中,避免了线程频繁创建与销毁的开销问题 线程池的结构 结构体 struct threadpool_t { pthread_mutex_t lock; //互斥锁 pthread_ ...
分类:
编程语言 时间:
2021-07-19 16:30:19
阅读次数:
0
public static void main(String[] args) { int[] aa = {5, 86, 21, 231, 4, 3, 1, 74}; paixu(aa); printaaaa(aa);}public static void paixu(int[] aa) { for ...
分类:
编程语言 时间:
2021-07-19 16:29:05
阅读次数:
0
实现代码: HMODULE GetProcessModuleHandle(DWORD pid, CONST TCHAR* moduleName){ // 根据 PID 、模块名(需要写后缀,如:".dll"),获取模块入口地址。 MODULEENTRY32 moduleEntry; HANDLE h ...
分类:
编程语言 时间:
2021-07-16 17:43:34
阅读次数:
0
之前写外挂做过指定进程的 Hook,但是没有尝试过全局 Hook,所以今天就来试试。全局 Hook 的用途我第一个就想到了键盘记录器(貌似我也就想到了这个 哈哈),那就写一个吧。 实现代码: #include <windows.h> #include<iostream> #include <stdi ...
分类:
编程语言 时间:
2021-07-16 17:43:16
阅读次数:
0
首先感谢 cyxvc 老哥,他的代码可读性超高,精简有用以理解,我找这方面的资料好久了,这篇文章对我帮助很大。 参考代码: #include "stdafx.h" #include <Windows.h> extern void DirectoryString(DWORD dwIndex); int ...
分类:
编程语言 时间:
2021-07-16 17:42:56
阅读次数:
0
Father.hpp 1 // 2 // Created by Administrator on 2021/7/15. 3 // 4 5 #ifndef C__TEST01_FATHER_HPP 6 #define C__TEST01_FATHER_HPP 7 8 9 class Father { ...
分类:
其他好文 时间:
2021-07-16 17:31:08
阅读次数:
0
用malloc和free;类似与C++的new和delete 代码: #include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { void* ptr = (void*)ma ...
分类:
编程语言 时间:
2021-07-15 18:57:44
阅读次数:
0
== equals是两种字符串的方式 区别 == 是比较两个对象的引用地址值 equals是比较两个对象的具体内容 示例 package com.oop.demo06; public class Demo01 { public static void main(String[] args) { St ...
分类:
其他好文 时间:
2021-07-14 18:50:51
阅读次数:
0
案例一、 public static void Main() { // Create the token source. CancellationTokenSource cts = new CancellationTokenSource(); // Pass the token to the can ...
分类:
编程语言 时间:
2021-07-14 18:50:15
阅读次数:
0
前言 使用链表实现队列,需要队首指向队列头部管理数据出对,队尾指向队列尾部管理数据入队。 具体实现 队列接口 public interface Queue<T> { /** * 元素入队 * @param t */ void enqueue(T t); /** * 元素出队 * @return */ ...
分类:
其他好文 时间:
2021-07-12 17:49:54
阅读次数:
0