ChinaUnix.net
相关文章推荐:

boost 线程结束

1.boost::thread 库中是否可以产生带有参数的线程,比如现有一个函数:string func(string s),我该如何生成多个线程?且每个线程传入的参数不一样. 2.我用多个线程调用同一个函数,但我想每次调用的函数实现的功能都不一样?比如,线程1和线程2,分别读数据库中的第一条和第二条记录? 我原来想的是在该函数中放一个全局变量,但不知道该如何实现互斥.其代码如下: #include #include <boost/thread/thread.hpp> using namespace...

by oitry_chen - C/C++ - 2008-08-29 22:52:16 阅读(4017) 回复(8)

相关讨论

[code] mutex::mutex() : m_mutex(0) , m_critical_section(false) { m_critical_section = true; if (m_critical_section) m_mutex = new_critical_section(); else m_mutex = new_mutex(0); } [/code] m_critical_section初始值为false, 进入构造函数又设置为true, (多此一举) 刚设完true, 又来用if判断 (再多此一举) 莫非这代码是机器人写的? 还是暗藏玄机, 实在不解, 衷心向各位请教.

by 飞灰橙 - C/C++ - 2006-09-15 14:12:26 阅读(1571) 回复(7)

看完了这篇文章http://www.kingofcoder.com/viewNews.php?type=newsCpp&id=85 之後在我的ubuntu 7.04上编译boost, 有这些问题 1) 找不到boost库的.a文件 2) 头文件好像不整, 那下呀?

by koc2 - C/C++ - 2007-06-29 20:19:47 阅读(1650) 回复(4)

大家好,小弟刚接触boost,遇到了不少的麻烦。 下面是我机器上的boost的安装目录:/home/zet/software/boost_1_39_0 系统是:ubuntu 以下是一个很简单的测试代码: [CODE] #include #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> int main() { boost::asio::io_service io; boost::asio::deadline_timer t(io,boost::posix_time::seconds(5)); t.wait()...

by solu - C/C++ - 2009-07-20 15:32:09 阅读(6047) 回复(12)

我现在在linux下编译一个用了boost/tokenizer.hpp库的源文件 代码如下: #include #include #include <boost/tokenizer.hpp> int main() { std::string str1 = "I-have-a-dog"; std::cout << str1 << std::endl; boost::char_separator sep("-"); boost::tokenizer<boost::char_separator > tokens(str1, sep); for (tokenizer::iterator tok_iter = tokens.begin(); tok_iter...

by kitty9fish - C/C++ - 2009-08-22 16:48:28 阅读(1455) 回复(1)

boost asio 发送HTTP协议 下载网页. 还没有读取完.但已经超过了设定的时段. 如何终止返回... 谁给此例子.

by ivscript - C/C++ - 2008-10-19 12:14:13 阅读(1449) 回复(0)

想用boost的正则匹配任意二进制文件中的"http.exe"字符串,但regex_search()的第一个参数是字符串,文件中遇到NULL就结束了,请问有没有别的办法? #include #include #include <boost/regex.hpp> #include #include #include using namespace std; using namespace boost; regex expression("http"); int main(int argc, char* argv[]) { // char *databuff="wo \n...

by wellfroggy - Perl - 2008-10-10 14:36:18 阅读(1512) 回复(1)

请问,我现在已经和客户机连上了,怎样获取它的端口?怎样主动对它发数据。 我已经有的对象 tcp::socket socket_; handler_allocator allocator_;

by lokeio - C/C++ - 2007-12-12 23:29:01 阅读(4810) 回复(4)

使用bjam完成编译后只出现了debug目录 没有多线程版本没有发布版本,如果解决? debug太大了 gcc (GCC) 3.3.4 Linux darkstar 2.4.30 #11 SMP Wed Oct 11 16:14:02 CST 2006 i686 unknown unknown GNU/Linux

by stuff990 - C/C++ - 2007-10-22 14:57:04 阅读(1507) 回复(2)

不清楚这个是不是该在c++版问 如题,正在使用PythonMagick做写图形处理的API,(别问我为什么不用PIL,上头不让用:em20: ) help(PythonMagick)中: | colorSpace(...) | C++ signature: | colorSpace(Magick::Image {lvalue}, MagickLib::ColorspaceType) -> void* 遇到这种MagickLib:: ,不知道传什么参数好,试过很多都不行,好像要自己写点什么,与boost有关? pythonmagick的文档网上少的...

by haterw - Python - 2007-09-27 11:34:20 阅读(3381) 回复(1)

本文转自: http://learn.tsinghua.edu.cn:8080/2005212716/html/boost_python.html boost.Python 是 boost 中的一个组件, 使用它能够大大简化用 C++ 为 Python 写扩展库的步骤,提高开发效率, 虽然目前它对 Python 嵌入 C++ 的支持还不是很多, 但也能提供很大方便。另外, 华宇煜 也编写了一份关于 boost.Python 简明教程 。 1 boost 安装简介 在正式开始使用 boost.Python 之前, 我们必须先编译 boost。 首先到 Boos...

by linxh - Python文档中心 - 2007-01-16 00:09:53 阅读(2441) 回复(0)