哪些 std::async 实现使用线程池?

2024-01-10

使用的优点之一std::async而不是手动创建std::thread对象应该是std::async可以在幕后使用线程池来避免超额订阅问题。但是哪些实现可以做到这一点呢?我的理解是微软的实现确实如此,但是其他的呢?async实施?

  • Gnu 的 libstdc++
  • LLVM 的 libc++
  • Just Software 的库
  • 升压(对于boost::thread::async, not std::async)

感谢您提供的任何信息。


黑盒测试

虽然“白盒”检查可以通过检查 boost、libstdc++ 或 libc++ 源代码或检查文档(例如只是::线程 http://www.stdthread.co.uk/doc/headers/future/async.html or MSVC 并发运行时 http://msdn.microsoft.com/en-us/library/dd984036.aspx,但我不能否认自己编写C++11代码的乐趣!

我已经做了黑盒测试 http://en.wikipedia.org/wiki/Black-box_testing:

现场演示 http://coliru.stacked-crooked.com/a/710f914687e3639d

#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_RESULT_OF_USE_DECLTYPE
#include <boost/exception/exception.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/move/iterator.hpp>
#include <boost/phoenix.hpp>
#include <boost/thread.hpp>
#include <boost/config.hpp>

#include <unordered_set>
#include <functional>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <ostream>
#include <cstddef>
#include <string>
#include <vector>
#include <future>
#include <thread>
#include <chrono>
#include <mutex>

// _____________________[CONFIGURATION]________________________ //
namespace async_lib = std;
const bool work_is_sleep = false;
// ____________________________________________________________ //

using namespace std;
using boost::phoenix::arg_names::arg1;
using boost::thread_specific_ptr;
using boost::back_move_inserter;
using boost::type_name;
using boost::count_if;
using boost::copy;

template<typename Mutex>
unique_lock<Mutex> locker(Mutex &m)
{
    return unique_lock<Mutex>(m);
}

void do_work()
{
    if(work_is_sleep)
    {
        this_thread::sleep_for( chrono::milliseconds(20) );
    }
    else
    {
        volatile double result=0.0;
        for(size_t i=0; i!=1<<22; ++i)
            result+=0.1;
    }
}

int main()
{
    typedef thread::id TID;
    typedef async_lib::future<TID> FTID;

    unordered_set<TID> tids, live_tids;
    vector<FTID> ftids;
    vector<int> live_tids_count;
    async_lib::mutex m;
    generate_n
    (
        back_move_inserter(ftids), 64*thread::hardware_concurrency(),
        [&]()
        {
            return async_lib::async([&]() -> TID
            {
                static thread_specific_ptr<bool> fresh;
                if(fresh.get() == nullptr)
                    fresh.reset(new bool(true));
                TID tid = this_thread::get_id();
                locker(m),
                    live_tids.insert(tid),
                    live_tids_count.push_back(int(live_tids.size()) * (*fresh ? -1 : 1));
                do_work();
                locker(m),
                    live_tids.erase(tid);
                *fresh = false;
                return tid;
            });
        }
    );
    transform
    (
        begin(ftids), end(ftids),
        inserter(tids, tids.end()),
        [](FTID &x){return x.get();}
    );

    cout << "Compiler = " << BOOST_COMPILER                             << endl;
    cout << "Standard library = " << BOOST_STDLIB                       << endl;
    cout << "Boost = " << BOOST_LIB_VERSION                             << endl;
    cout << "future type = " << type_name<FTID>()                       << endl;
    cout << "Only sleep in do_work = " << boolalpha << work_is_sleep    << endl;
    cout << string(32,'_')                                              << endl;
    cout << "hardware_concurrency = " << thread::hardware_concurrency() << endl;
    cout << "async count = " << ftids.size()                            << endl;
    cout << "unique thread id's = " << tids.size()                      << endl;
    cout << "live threads count (negative means fresh thread):"                ;
    copy(live_tids_count, ostream_iterator<int>(cout," "));        cout << endl;
    cout << "fresh count = " << count_if(live_tids_count, arg1 < 0)     << endl;
}

Compiler = Microsoft Visual C++ version 11.0
Standard library = Dinkumware standard library version 540
Boost = 1_53
future type = class std::future<class std::thread::id>
Only sleep in do_work = false
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 4
live threads count (negative means fresh thread):-1 -2 2 2 -3 -4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4
 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
fresh count = 4

Compiler = Microsoft Visual C++ version 11.0
Standard library = Dinkumware standard library version 540
Boost = 1_53
future type = class std::future<class std::thread::id>
Only sleep in do_work = true
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 34
live threads count (negative means fresh thread):-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 18 18 18 18 18 18 18 18 18 18 18 18 18
 18 18 18 18 -19 19 -20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 -21 21 21 -22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 -
23 23 23 23 -24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 -25 25 25 25 25 -26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26
26 26 26 -27 27 27 27 27 27 -28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 -29 29 29 29 29 29 29 -30 30 30 30 30 30 30 30 30 30
 30 30 30 30 30 30 30 30 30 30 30 30 30 30 -31 31 31 31 31 31 31 31 -32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 -33 33
 33 33 33 33 33 33 33 -34 34 34 34 34 34 34 34 34 11 12 11 12 13 14 15 16 15 10 11 12 13 14
fresh count = 34

Compiler = Microsoft Visual C++ version 11.0
Standard library = Dinkumware standard library version 540
Boost = 1_53
future type = class boost::future<class std::thread::id>
Only sleep in do_work = false
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 256
live threads count (negative means fresh thread):-1 -2 -2 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -3 -4 -4 -4 -4 -4 -4 -4
 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -2 -3 -3 -3 -3 -4 -4 -4 -4 -2 -2 -2 -2 -3
 -2 -2 -3 -1 -2 -2 -3 -3 -1 -2 -1 -2 -3 -2 -2 -2 -2 -1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -3 -2 -2 -2 -2 -3 -3 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -1 -2 -1 -2 -1 -2 -1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -3 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -3 -2 -2 -3 -1 -2 -1 -2 -2 -2 -3 -2 -3 -1 -2 -2 -2 -3 -2 -3 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -3 -3 -2 -2 -2 -3
fresh count = 256

Compiler = Microsoft Visual C++ version 11.0
Standard library = Dinkumware standard library version 540
Boost = 1_53
future type = class boost::future<class std::thread::id>
Only sleep in do_work = true
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 256
live threads count (negative means fresh thread):-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -2
8 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65
-66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102
 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132
 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162
 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192
 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222
 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252
 -253 -254 -255 -256
fresh count = 256

Compiler = GNU C++ version 4.8.0-alpha20121216 20121216 (experimental)
Standard library = GNU libstdc++ version 20121216
Boost = 1_53
future type = std::future<std::thread::id>
Only sleep in do_work = false
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 1
live threads count (negative means fresh thread):-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
fresh count = 1

Compiler = GNU C++ version 4.8.0-alpha20121216 20121216 (experimental)
Standard library = GNU libstdc++ version 20121216
Boost = 1_53
future type = boost::future<std::thread::id>
Only sleep in do_work = false
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 122
live threads count (negative means fresh thread):-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -20 -21 -22 -23 -24 -25 -25 -26 -27 -28 -29 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -59 -60 -61 -62 -63 -64 -64 -64 -63 -61 -55 -48 -41 -33 -34 -27 -27 -28 -29 -29 -30 -31 -31 -30 -28 -29 -28 -28 -28 -29 -30 -30 -31 -30 -31 -31 -31 -32 -31 -26 -24 -25 -26 -25 -23 -23 -22 -20 -21 -19 -20 -20 -19 -20 -21 -21 -22 -21 -22 -23 -24 -24 -25 -26 -27 -25 -25 -25 -22 -23 -22 -23 -23 -24 -25 -26 -27 -27 -28 -29 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -51 -52 -53 -54 -55 -56 -57 -56 -54 -3 -3 -4 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -55 -56 -57 -58 -59 -60 -61 -61 -61 -62 -63 -64 -65 -64 -62 -63 -63 -61 -62 -61 -59 -60 -59 -57 -55 -56
fresh count = 256

Compiler = Clang version 3.2 (tags/RELEASE_32/final)
Standard library = libc++ version 1101
Boost = 1_53
future type = NSt3__16futureINS_11__thread_idEEE
Only sleep in do_work = false
________________________________
hardware_concurrency = 4
async count = 256
unique thread id's = 255
live threads count (negative means fresh thread):-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -121 -122 -122 -123 -123 -124 -125 -126 -127 -126 -127 -128 -129 -129 -128 -129 -128 -129 -129 -128 -129 -129 -128 -126 -127 -128 -128 -129 -129 -130 -129 -129 -128 -129 -129 -130 -131 -132 -133 -134 -135 -136 -134 -132 -133 -134 -134 -133 -132 -133 -132 -133 -134 -133 -131 -129 -127 -124 -125 -121 -119 -120 -118 -119 -118 -117 -115 -111 -107 -105 -106 -103 -100 -97 -95 -96 -94 -90 -87 -81 -73 -74 -71 -72 -73 -74 -75 -70 -71 -66 -60 -59 -60 -61 -62 -63 -64 -61 -58 -55 -55 -52 -53 -54 -54 -55 -56 -56 -57 -54 -55 -56 -56 -57 -57 -58 -56 -54 -55 -56 -56 -57 -58 -58 -59 -58 -58 -58 -58 -59 -60
fresh count = 256

可以看出 - MSVC 确实重用了线程,即它的方案很可能是某种线程池。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

哪些 std::async 实现使用线程池? 的相关文章

  • 异步迭代器

    我有以下代码 while slowIterator hasNext performLengthTask slowIterator next 由于迭代器和任务都很慢 因此将它们放入单独的线程中是有意义的 这是对迭代器包装器的快速而肮脏的尝试
  • C# 和 Javascript SHA256 哈希的代码示例

    我有一个在服务器端运行的 C 算法 它对 Base64 编码的字符串进行哈希处理 byte salt Convert FromBase64String serverSalt Step 1 SHA256Managed sha256 new S
  • ASP.NET Core Serilog 未将属性推送到其自定义列

    我有这个设置appsettings json对于我的 Serilog 安装 Serilog MinimumLevel Information Enrich LogUserName Override Microsoft Critical Wr
  • Qt-Qlist 检查包含自定义类

    有没有办法覆盖加载自定义类的 Qt QList 的比较机制 即在 java 中你只需要重写一个比较方法 我有一个带有我的自定义类模型的 QList QList
  • 获取按下的按钮的返回值

    我有一个在特定事件中弹出的表单 它从数组中提取按钮并将标签值设置为特定值 因此 如果您要按下或单击此按钮 该函数应返回标签值 我怎样才能做到这一点 我如何知道点击了哪个按钮 此时代码返回 DialogResult 但我想从函数返回 Tag
  • 从父类调用子类方法

    a doStuff 方法是否可以在不编辑 A 类的情况下打印 B did stuff 如果是这样 我该怎么做 class Program static void Main string args A a new A B b new B a
  • 未解决的包含:“cocos2d.h” - Cocos2dx

    当我在 Eclipse 中导入 cocos2dx android 项目时 我的头文件上收到此警告 Unresolved inclusion cocos2d h 为什么是这样 它实际上困扰着我 该项目可以正确编译并运行 但我希望这种情况消失
  • linux perf:如何解释和查找热点

    我尝试了linux perf https perf wiki kernel org index php Main Page今天很实用 但在解释其结果时遇到了困难 我习惯了 valgrind 的 callgrind 这当然是与基于采样的 pe
  • C++ 子字符串返回错误结果

    我有这个字符串 std string date 20121020 我正在做 std cout lt lt Date lt lt date lt lt n std cout lt lt Year lt lt date substr 0 4 l
  • 如何忽略“有符号和无符号整数表达式之间的比较”?

    谁能告诉我必须使用哪个标志才能使 gcc 忽略 有符号和无符号整数表达式之间的比较 警告消息 gcc Wno sign compare 但你确实应该修复它警告你的比较
  • Cython 和类的构造函数

    我对 Cython 使用默认构造函数有疑问 我的 C 类 Node 如下 Node h class Node public Node std cerr lt lt calling no arg constructor lt lt std e
  • WPF TabControl,用C#代码更改TabItem的背景颜色

    嗨 我认为这是一个初学者的问题 我搜索了所有相关问题 但所有这些都由 xaml 回答 但是 我需要的是后台代码 我有一个 TabControl 我需要设置其项目的背景颜色 我需要在选择 取消选择和悬停时为项目设置不同的颜色 非常感谢你的帮助
  • 如何返回 json 结果并将 unicode 字符转义为 \u1234

    我正在实现一个返回 json 结果的方法 例如 public JsonResult MethodName Guid key var result ApiHelper GetData key Data is stored in db as v
  • 如何将图像路径保存到Live Tile的WP8本地文件夹

    我正在更新我的 Windows Phone 应用程序以使用新的 WP8 文件存储 API 本地文件夹 而不是 WP7 API 隔离存储文件 旧的工作方法 这是我如何成功地将图像保存到 共享 ShellContent文件夹使用隔离存储文件方法
  • 如何让Gtk+窗口背景透明?

    我想让 Gtk 窗口的背景透明 以便只有窗口中的小部件可见 我找到了一些教程 http mikehearn wordpress com 2006 03 26 gtk windows with alpha channels https web
  • C - 直接从键盘缓冲区读取

    这是C语言中的一个问题 如何直接读取键盘缓冲区中的数据 我想直接访问数据并将其存储在变量中 变量应该是什么数据类型 我需要它用于我们研究所目前正在开发的操作系统 它被称为 ICS OS 我不太清楚具体细节 它在 x86 32 位机器上运行
  • 如何使用 std::string 将所有出现的一个字符替换为两个字符?

    有没有一种简单的方法来替换所有出现的 in a std string with 转义 a 中的所有斜杠std string 完成此操作的最简单方法可能是boost字符串算法库 http www boost org doc libs 1 46
  • ASP.NET MVC 6 (ASP.NET 5) 中的 Application_PreSendRequestHeaders 和 Application_BeginRequest

    如何在 ASP NET 5 MVC6 中使用这些方法 在 MVC5 中 我在 Global asax 中使用了它 现在呢 也许是入门班 protected void Application PreSendRequestHeaders obj
  • 使用 libcurl 检查 SFTP 站点上是否存在文件

    我使用 C 和 libcurl 进行 SFTP FTPS 传输 在上传文件之前 我需要检查文件是否存在而不实际下载它 如果该文件不存在 我会遇到以下问题 set up curlhandle for the public private ke
  • 使用按位运算符相乘

    我想知道如何使用按位运算符将一系列二进制位相乘 但是 我有兴趣这样做来查找二进制值的十进制小数值 这是我正在尝试做的一个例子 假设 1010010 我想使用每个单独的位 以便将其计算为 1 2 1 0 2 2 1 2 3 0 2 4 虽然我

随机推荐

  • 无法解析“.NETCoreApp,版本=v2.1”的“Microsoft.NETCore.App (>= 2.1.0)”

    我正在尝试用以下方法解决 nuget 包dotnet restore 但出现以下错误 无法解析 NETCoreApp 版本 v2 1 的 Microsoft NETCore App gt 2 1 0 这是我的 csproj file
  • Android Studio 3.3 错误

    I recently upgraded to Android Studio 3 3 and I ve been working on projects using the IDE for the last week I ve noticed
  • 在 Java 堆空间异常上运行 Cucumber 测试后 Jenkins 构建失败

    使用 Jenkins 构建时出现以下异常 运行 Cucumber 测试后会引发此异常 谁能告诉我java堆空间上失败的确切位置吗 您知道可以采取什么措施来解决这个问题吗 一些背景 我在 Cucumber 测试期间有一个 java 堆空间 在
  • 如何将目录中自动生成的文件列表添加到 JS 文件中?

    我正在用 HTML5 编写一个在线游戏 其中一个文件包含资源列表 这些资源全部位于resources img 文件夹 现在我希望根据此文件夹的内容自动生成此列表 而不必每次添加新图像时手动更新它 我很确定 Grunt 可以做到这一点 但我不
  • 系统安全异常?

    描述 应用程序试图执行安全策略不允许的操作 要授予此应用程序所需的权限 请联系您的系统管理员或在配置文件中更改应用程序的信任级别 异常详细信息 System Security SecurityException 请求 System Secu
  • 将使用react-router v5完成的BreadCrumb组件更改为react router v6

    我想更改使用react router v5完成的BreadCrumb组件以反应router v6 import React from react import Breadcrumbs as MUIBreadcrumbs Link Typog
  • MySQL动态交叉表

    我有一个这样的表 way stop time 1 1 00 55 1 2 01 01 1 3 01 07 2 2 01 41 2 3 01 47 2 5 01 49 3 1 04 00 3 2 04 06 3 3 04 12 我想要一个这样
  • 如何使用 RESTEasy 代理客户端发送查询参数映射

    我正在寻找一种将包含参数名称和值的映射传递到 GET Web 目标的方法 我期待 RESTEasy 将我的地图转换为 URL 查询参数列表 然而 RESTEasy 抛出一个异常说Caused by javax ws rs Processin
  • 递归构建分层 JSON 树?

    我有一个父子关系数据库 数据如下所示 但可以以您想要的任何方式呈现 字典 列表列表 JSON 等 links Tom Dick Dick Harry Tom Larry Bob Leroy Bob Earl 我需要的输出是一个分层 JSON
  • 处理文件名中的特殊字符时批量重命名问题

    我在 c files 中有数百个 mp3 文件 里面有所有可以想象到的文件名 例如 milad mp3 表现良好 嘿你 mp3 文件名中有空格 systemofadown mp3 长文件名 howdy 1 mp3 文件名中的括号 以及最后三
  • 将空图添加到构面,并与另一个构面组合

    Using this SO solution https stackoverflow com questions 30372368 adding empty graphs to facet wrap in ggplot2 I created
  • 可复制的 Coldfusion SQL 异常

    每当 CF 抛出错误时 我都会收到一封包含所有异常信息的电子邮件 每次涉及数据库错误时 我都会得到 SQL WHERE 和 QueryError 信息 这很好 SQL SELECT FooID FROM FooTable WHERE Foo
  • 从会话 Codeigniter 中回显用户

    我是 codeigniter 的新手 我已经实现了一个简单的登录系统 我想在我的视图页面上打印存储在会话中的用户名 这是我的控制器 class LoginController extends CI Controller function i
  • 通过触摸跳转 Unity C#

    我在 Unity C 上编写游戏 这是简单的跑步者 我有 Platformer2DUserControl 脚本 就这个 using UnityEngine using UnitySampleAssets CrossPlatformInput
  • 什么是编程语言? [复制]

    这个问题在这里已经有答案了 可能的重复 什么是计算机编程语言 https stackoverflow com questions 1325686 what is a computer programming language 不完全是 我一
  • 静态 Linkedhashmap 还是 Sharedpreference?

    Android 应用程序具有两种在活动之间传递数据的解决方案 请不要意图额外 public class A public static LinkedHashMap
  • 如何在jquery中右键单击添加dbclick()

    您好 我想在右键单击时使用 dblclick 因为谷歌地图必须放大和缩小 有什么办法可以做到这一点吗 我已经编写了 dblclick 但现在它只需要左键单击即可工作 有关如何执行此操作的任何指示 这是我的代码 div demo1 dblcl
  • Swift 仅针对某些错误类型组合重试

    我有一个自定义管道 我想对一些可恢复的错误代码进行 3 次重试 并且我想为可恢复的错误添加一些短暂的延迟 有人知道我该怎么做吗 func createRequest for message Message gt AnyPublisher
  • 编译期间未包含在目标中的 .h 文件会发生什么情况?

    我有一个 Common h 文件 其中存储了在我的项目中重复使用的所有字符串 namespace Common static const std string mystring IamAwesum 因此 在任何需要特定字符串的文件中 我都包
  • 哪些 std::async 实现使用线程池?

    使用的优点之一std async而不是手动创建std thread对象应该是std async可以在幕后使用线程池来避免超额订阅问题 但是哪些实现可以做到这一点呢 我的理解是微软的实现确实如此 但是其他的呢 async实施 Gnu 的 li