问题描述
我正在研究多线程,与使用pthread.h
和pthreads-win32
手动编写解决方案相比,GCD似乎是一个更好的选择.但是,尽管libdispatch
似乎正在或即将在大多数较新的POSIX兼容系统上工作,但是……我不得不问Windows呢? libdispatch
移植到Windows的机会是什么?阻止这种情况发生的障碍是什么?
I’m looking into multithreading, and GCD seems like a much better option than manually writing a solution using pthread.h
and pthreads-win32
. However, although it looks like libdispatch
is either working on, or soon going to be working on, most newer POSIX-compatible systems… I have to ask, what about Windows? What are the chances of libdispatch
being ported to Windows? What are the barriers preventing that from happening?
如果涉及到这个问题,我需要做什么来执行该搬运工作?
If it came down to it, what would I need to do to preform that portage?
编辑:我已经知道一些要开始讨论的内容:
Some things I already know, to get the discussion started:
- 我们需要一个与块兼容的编译器,它将在Windows上编译,不是吗? PLBlocks 可以处理吗?
- 我们可以使用LLVM 阻止运行时吗?
- 为了可移植性,我们不能用APR调用替换用户空间
libdispatch
中的所有pthread.h
依赖项吗?或者,也可以使用我想的pthreads-win32
…
- We need a blocks-compatible compiler that will compile on Windows, no? Will PLBlocks handle that?
- Can we use the LLVM blocks runtime?
- Can’t we replace all the
pthread.h
dependencies in userspacelibdispatch
with APR calls, for portability? Or, alternatively, usepthreads-win32
I suppose…
我听说这是完全完全不可能的,因为libdispatch
取决于(以某种方式)取决于 kqueue
,无法在Windows上使用…有人知道这是真的吗?
Edit 1: I am hearing that this is completely and totally impossible, ever, because libdispatch
depends (somehow) on kqueue
, which can’t be made available on Windows… does anybody know if this is true?
推荐答案
看看: http: //opensource.mlba-team.de/xdispatch/这个项目(和其他第三方库)将libdispatch引入了macosx以外的平台(Windows,Linux)
Take a look at : http://opensource.mlba-team.de/xdispatch/This project (and other third-party libs) brings libdispatch into platforms(windows, linux) other than macosx
这篇关于是否可以在Windows上使用Grand Central Dispatch(`libdispatch`)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!