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?
Edit: Some things I already know, to get the discussion started:
pthread.h
dependencies in userspace libdispatch
with APR calls, for portability? Or, alternatively, use pthreads-win32
I suppose…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?
Grand Central Dispatch is used in iOS to introduce concurrency and parallelism in the iOS applications, so that multiple heavy tasks are performed in the background, resulting in the smooth experience of the application usage, as the main thread is unaffected by the heavy background tasks.
Grand Central Dispatch (GCD or libdispatch), is a technology developed by Apple Inc. to optimize application support for systems with multi-core processors and other symmetric multiprocessing systems. It is an implementation of task parallelism based on the thread pool pattern.
GCD is built on top of threads. Under the hood, it manages a shared thread pool. With GCD, you add blocks of code or work items to dispatch queues and GCD decides which thread to execute them on. As you structure your code, you'll find code blocks that can run simultaneously and some that should not.
Dispatch, also known as Grand Central Dispatch (GCD), contains language features, runtime libraries, and system enhancements that provide systemic, comprehensive improvements to the support for concurrent code execution on multicore hardware in macOS, iOS, watchOS, and tvOS.
https://github.com/DrPizza/libdispatch
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With