是否可以在Windows上使用Grand Central Dispatch(`libdispatch`)? [英] Could Grand Central Dispatch (`libdispatch`) ever be made available on Windows?

查看:111
本文介绍了是否可以在Windows上使用Grand Central Dispatch(`libdispatch`)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究多线程,与使用pthread.hpthreads-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 userspace libdispatch with APR calls, for portability? Or, alternatively, use pthreads-win32 I suppose…

我听说这是完全完全不可能的,因为libdispatch取决于(以某种方式)取决于

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`)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆