EAThread - EAThread implements a unified cross-platform interface for multithreaded programming.

Overview

EAThread

EAThread implements a unified cross-platform interface for multithreaded programming on various platforms.

Build Status

Documentation

Please see Introduction.

Compiling sources

Please see CONTRIBUTING.md for details on compiling and testing the source.

Credits

Roberto Parolin is the current EAThread owner within EA and is responsible for the open source repository.

License

Modified BSD License (3-Clause BSD license) see the file LICENSE in the project root.

Comments
  • Use EABase defines over raw platform checks

    Use EABase defines over raw platform checks

    This is a huge one, sorry for that.

    These commits get rid of raw platform/process/library/compilers defines, i.e. _MSC_VER. And it replaces MSVC warning pragmas with EA_DISABLE_VC_WARNING and the likes. I think this is more clear, and easier to read/reason about.

    I can split the first commit up in smaller, easier digestible commits if needed.

    opened by RA-Kooi 4
  • Android arm64 build error

    Android arm64 build error

    When trying to build EAThread using the 64 bit compilers from the NDK, I get the following errors:

    In file included from ../../library/eaoss/src/EAThread/eathread.cpp:89:
    ../../library/eaoss/src/EAThread/android/eathread_fake_atomic_64.cpp:37:26: error: cast from pointer to smaller type 'unsigned int' loses information
            pthread_mutex_t* lock = EAT_SWAP_LOCK(addr);
                                    ^~~~~~~~~~~~~~~~~~~
    ../../library/eaoss/src/EAThread/android/eathread_fake_atomic_64.cpp:31:54: note: expanded from macro 'EAT_SWAP_LOCK'
    #define EAT_SWAP_LOCK(addr) &sFakeAtomic64SwapLocks[((unsigned)(void*)(addr) >> 3U) % EAT_FAKE_ATOMIC_SWAP_LOCK_COUNT]
                                                         ^~~~~~~~~~~~~~~~~~~~~~~
    ../../library/eaoss/src/EAThread/android/eathread_fake_atomic_64.cpp:52:26: error: cast from pointer to smaller type 'unsigned int' loses information
            pthread_mutex_t* lock = EAT_SWAP_LOCK(addr);
                                    ^~~~~~~~~~~~~~~~~~~
    ../../library/eaoss/src/EAThread/android/eathread_fake_atomic_64.cpp:31:54: note: expanded from macro 'EAT_SWAP_LOCK'
    #define EAT_SWAP_LOCK(addr) &sFakeAtomic64SwapLocks[((unsigned)(void*)(addr) >> 3U) % EAT_FAKE_ATOMIC_SWAP_LOCK_COUNT]
                                                         ^~~~~~~~~~~~~~~~~~~~~~~
    ../../library/eaoss/src/EAThread/android/eathread_fake_atomic_64.cpp:73:26: error: cast from pointer to smaller type 'unsigned int' loses information
            pthread_mutex_t* lock = EAT_SWAP_LOCK(addr);
                                    ^~~~~~~~~~~~~~~~~~~
    ../../library/eaoss/src/EAThread/android/eathread_fake_atomic_64.cpp:31:54: note: expanded from macro 'EAT_SWAP_LOCK'
    #define EAT_SWAP_LOCK(addr) &sFakeAtomic64SwapLocks[((unsigned)(void*)(addr) >> 3U) % EAT_FAKE_ATOMIC_SWAP_LOCK_COUNT]
                                                         ^~~~~~~~~~~~~~~~~~~~~~~
    3 errors generated.
    
    

    Changing that macro to use unsigned long for 64 bit builds eliminates the error, but I'm not sure if that will break functionality since it's not clear to me what that macro is doing.

    opened by AlexRamallo 1
  • Fix CMake build on Ubuntu

    Fix CMake build on Ubuntu

    Change EABase from link to include - the libraries won't build otherwise on Ubuntu. I'm guessing that in the past EABase was a binary library to link against, and was changed to header only - but I didn't chase its history.

    opened by OfekShilon 0
  • MinGW-w64 fixes

    MinGW-w64 fixes

    In this PR I made MinGW-w64 compilers work again with EAThread.
    I opted for using pthreads, as those are native to MinGW-w64 and GCC has no support for SEH intrinsics, such as __try and __catch.

    I tested this with GCC, Clang, MSVC, and Clang-CL, but I can't remember if I tested it on Linux.

    If possible I'd like to extend EAThread to be numa-aware somewhere in the future, so that MinGW users can make use of all threads on new high core count CPUs. I'm assuming the MSVC side is already numa aware.

    As usual, let me know if there are any issues with the PR :)

    opened by RA-Kooi 3
  • Files with the same name

    Files with the same name

    eathread_pthread_stack_info.cpp in both Kettle and unix folders causes the MSVC compiler to complain.

    Renaming them to _kettle and _unix removes the warning.

    opened by BobbyAnguelov 2
Owner
Electronic Arts
Electronic Arts
Header-only library for multithreaded programming

CsLibGuarded Introduction The CsLibGuarded library is a standalone header only library for multithreaded programming. This library provides templated

CopperSpice 183 Nov 22, 2022
A easy to use multithreading thread pool library for C. It is a handy stream like job scheduler with an automatic garbage collector. This is a multithreaded job scheduler for non I/O bound computation.

A easy to use multithreading thread pool library for C. It is a handy stream-like job scheduler with an automatic garbage collector for non I/O bound computation.

Hyoung Min Suh 12 Jun 4, 2022
Single header asymmetric stackful cross-platform coroutine library in pure C.

minicoro Minicoro is single-file library for using asymmetric coroutines in C. The API is inspired by Lua coroutines but with C use in mind. The proje

Eduardo Bart 368 Nov 18, 2022
cross platform subprocess library for c++ similar to design of python subprocess

subprocess cross platform subprocess library for c++ similar to design of python subprocess. See subprocess documentation for further documentation. s

null 123 Nov 22, 2022
Arcana.cpp - Arcana.cpp is a collection of helpers and utility code for low overhead, cross platform C++ implementation of task-based asynchrony.

Arcana.cpp Arcana is a collection of general purpose C++ utilities with no code that is specific to a particular project or specialized technology are

Microsoft 67 Nov 23, 2022
Fiber - A header only cross platform wrapper of fiber API.

Fiber Header only cross platform wrapper of fiber API A fiber is a particularly lightweight thread of execution. Which is useful for implementing coro

Tony Wang 41 Jul 31, 2022
Rpmalloc - Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C

rpmalloc - General Purpose Memory Allocator This library provides a public domain cross platform lock free thread caching 16-byte aligned memory alloc

Mattias Jansson 1.7k Nov 22, 2022
Kokkos C++ Performance Portability Programming EcoSystem: The Programming Model - Parallel Execution and Memory Abstraction

Kokkos: Core Libraries Kokkos Core implements a programming model in C++ for writing performance portable applications targeting all major HPC platfor

Kokkos 1.2k Nov 27, 2022
A General-purpose Parallel and Heterogeneous Task Programming System

Taskflow Taskflow helps you quickly write parallel and heterogeneous tasks programs in modern C++ Why Taskflow? Taskflow is faster, more expressive, a

Taskflow 7.5k Nov 28, 2022
C++React: A reactive programming library for C++11.

C++React is reactive programming library for C++14. It enables the declarative definition of data dependencies between state and event flows. Based on

Sebastian 966 Nov 27, 2022
:copyright: Concurrent Programming Library (Coroutine) for C11

libconcurrent tiny asymmetric-coroutine library. Description asymmetric-coroutine bidirectional communication by yield_value/resume_value native conte

sharow 350 Sep 2, 2022
A competitive programming helper tool, which packages included libraries into a single file, suitable for online judges.

cpack Cpack is a competitive programming helper tool, which packages the main source file along with included libraries into a single file, suitable f

PetarMihalj 11 Apr 22, 2022
Material for the UIBK Parallel Programming Lab (2021)

UIBK PS Parallel Systems (703078, 2021) This repository contains material required to complete exercises for the Parallel Programming lab in the 2021

null 12 May 6, 2022
A General-purpose Parallel and Heterogeneous Task Programming System

Taskflow Taskflow helps you quickly write parallel and heterogeneous task programs in modern C++ Why Taskflow? Taskflow is faster, more expressive, an

Taskflow 7.5k Nov 21, 2022
High Performance Linux C++ Network Programming Framework based on IO Multiplexing and Thread Pool

Kingpin is a C++ network programming framework based on TCP/IP + epoll + pthread, aims to implement a library for the high concurrent servers and clie

null 23 Oct 19, 2022
Cpp-taskflow - Modern C++ Parallel Task Programming Library

Cpp-Taskflow A fast C++ header-only library to help you quickly write parallel programs with complex task dependencies Why Cpp-Taskflow? Cpp-Taskflow

null 4 Mar 30, 2021
ParallelComputingPlayground - Shows different programming techniques for parallel computing on CPU and GPU

ParallelComputingPlayground Shows different programming techniques for parallel computing on CPU and GPU. Purpose The idea here is to compute a Mandel

Morten Nobel-Jørgensen 2 May 16, 2020
Awesome-lockfree - A collection of resources on wait-free and lock-free programming

Awesome Lock-Free A collection of resources on wait-free and lock-free programming. ?? ?? ?? Even better resource from MattPD: C++ links: atomics, loc

Erik Rigtorp 1.4k Nov 18, 2022
Yoga is a cross-platform layout engine which implements Flexbox

Yoga Building Yoga builds with buck. Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to su

Meta 15.7k Nov 19, 2022
XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner

XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner and RandomX benchmark. Official binaries are available for Windows, Linux, macOS and FreeBSD.

null 7.3k Nov 28, 2022