首页 > TAG信息列表 > bufferSize

【Windows内核研究】使用 NtQuerySystemInformation API 获取进程信息

需要附加依赖项ntdll.lib 需要导入NtQuerySystemInformation等相关函数的定义。这里使用了ProcessHacker的phnt库。 Github ProcessHacker phnt 代码如下: #include <iostream> #include <phnt_windows.h> #include <phnt.h> using namespace std; #define PTR_ADD_OFFSET(Poin

twobuffer

#pragma once #include <stdio.h> #include <iostream> #include <string> #include <thread> #include <mutex> class CTwoBuffer { public: CTwoBuffer() :buffer1(nullptr) , buffer2(nullptr) , bufferRead(n

SpringCloud升级之路2020.0.x版-13.UnderTow 核心配置

本系列代码地址:https://github.com/HashZhang/spring-cloud-scaffold/tree/master/spring-cloud-iiford Undertow 的配置可以参考 Undertow 的 Builder,并且其中也有一些默认的配置参数: Undertow private Builder() { ioThreads = Math.max(Runtime.getRuntime().available

C# 读取 sql server 大型字段(单个字段大小超过10G)

如果电脑内存够大,并且只为这一个程序服务,当然这不是问题,可大多数场景并非如此。 var file = @"a.zip"; using (var conn = new SqlConnection("Data Source=.;Integrated Security=SSPI;Initial Catalog=ABC")) { conn.Open(); var sql = "SELECT TOP 1 BulkColumn FROM

C++动态数组的作用

假如要创建一个数组,数组长度由用户输入 那就可以这样写: int bufferSize; cin>>bufferSize; int *p=new int[bufferSize]; 但是,如果用静态数组实现这个功能请问怎么实现? int bufferSize; cin>>bufferSize; int arr[bufferSize];吗?系统编译不过的 静态数组是在堆栈上分配的,在编译

线程安全的无锁RingBuffer的实现

本人免费整理了Java高级资料,涵盖了Java、Redis、MongoDB、MySQL、Zookeeper、Spring Cloud、Dubbo高并发分布式等教程,一共30G,需要自己领取。传送门:https://mp.weixin.qq.com/s/JzddfH-7yNudmkjT0IRL8Q   在程序设计中,我们有时会遇到这样的情况,一个线程将数据写到一个buffer中,另

java BufferSegment

package org.rx.util;import java.util.function.Consumer;import static org.rx.core.Contract.require;public class BufferSegment { private final byte[] buffer; private final int bufferSize; private volatile int offset; private volatile boolean aut

disruptor第二弹(建基)

前言:大概认识了disruptor之后,我们来实现一个小型的disruptor。然后从这个小型的disruptor进行扩展。 使用网上的一个突破  head:代表我们要读的位置 tail:代表我们写的位置 bufferSize:代表一圈的大小 数据为空的条件 :head=tail 一个buffer是否满:head=tail%bufferSize+1(说明

cocos2d::CCFileUtils::sharedFileUtils()->getFileData(szFile, "r", &bufferSize) 不同平台返回值不

string pathKey = CCFileUtils::sharedFileUtils()->fullPathForFilename(fileName); unsigned char* pBuffer = NULL; unsigned long bufferSize = 0; pBuffer = CCFileUtils::sharedFileUtils()->getFileData(pathKey.c_str(), "rb", &

调用Windows API实现GBK和UTF-8的相互转换

GBK转UTF-8示例 GbkToUtf8.cpp #include <Windows.h> #include <iostream> #include <string> #include <fstream> int main() { using namespace std; string multiByteString = "我25岁。\nI'm 25 years old."; int bufferS