我正在运行Linux Mint 14.1 64位
我安装了以下库:
mesa-common-dev,freeglut3-dev,libglew-dev
通过apt-get工具.
这是我的包含,位于我的Main.h文件中:
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <time.h>
Run Code Online (Sandbox Code Playgroud)
我检查了libs安装正确,它们似乎位于/ usr/lib/x86_64-linux-gnu 和/ usr/include/GL中的头文件
我继续使用以下标志编译我的Main.C文件:
g++ -Wall -Wextra -Weffc++ -Winit-self -Wmissing-include-dirs -Wswitch-default -switch-enum -Wunused-parameter -Wstrict-overflow=5 -Wfloat-equal -Wshadow -Wc++0x-compat -Wconversion -Wsign-conversion -Wmissing-declarations -Wstrict-null-sentinel -Woverloaded-virtual -Wsign-promo -Werror -pedantic -Wcast-qual -fno-pretty-templates -fmessage-length=80 -fdiagnostics-show-option -g -std=c++0x -pipe -frepo -c Main.C -o Main.o
Run Code Online (Sandbox Code Playgroud)
生成Main.o没有任何问题,然后我尝试创建二进制文件:
g++ -I/usr/include -L/usr/lib/x86_64-linux-gnu -lGL -lglut -lGLU -lGLEW …Run Code Online (Sandbox Code Playgroud) 我有一台通过TCP LAN与50个或更多设备进行通信的服务器。每个套接字读取消息循环都有一个Task.Run。
我将每条消息的到达缓冲到一个阻塞队列中,在每个阻塞队列中都有一个使用BlockingCollection.Take()的Task.Run。
所以像(半伪代码):
套接字读取任务
Task.Run(() =>
{
while (notCancelled)
{
element = ReadXml();
switch (element)
{
case messageheader:
MessageBlockingQueue.Add(deserialze<messageType>());
...
}
}
});
Run Code Online (Sandbox Code Playgroud)
消息缓冲区任务
Task.Run(() =>
{
while (notCancelled)
{
Process(MessageQueue.Take());
}
});
Run Code Online (Sandbox Code Playgroud)
因此,这将使50多个读取任务和50多个任务在自己的缓冲区中阻塞。
我这样做是为了避免阻塞阅读循环,并允许程序更公平地分配对消息的处理时间,所以我相信。
这是一种低效的处理方式吗?有什么更好的方法?
c# parallel-processing performance networking multithreading
我正在尝试使用 http2/grpc 流媒体,但我的连接在 15 秒内中断。关于超时设置的文档说将超时设置为 0。但是,当我这样做时,Envoy 在启动时抛出错误,抱怨 0 不是 Duration 类型的有效值。
如何禁用路由超时?
这是我的 Envoy 配置 .yml
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
port_value: 8801
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 11001
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: ingress_http
http_filters:
- name: envoy.filters.http.router
route_config:
name: grpc_route
virtual_hosts:
- name: grpc_service
domains: ["*"]
routes:
- name: grpc_proxy
match:
prefix: "/"
route:
timeout: 0 # How do I disable the …Run Code Online (Sandbox Code Playgroud) networking ×2
c# ×1
c++ ×1
envoyproxy ×1
freeglut ×1
grpc ×1
http2 ×1
linker ×1
linux ×1
linux-mint ×1
performance ×1