Giter Club home page Giter Club logo

libpwq's Introduction


IMPORTANT NOTE: This project is no longer being maintained.

libpwq was designed to be used with an older version of libdispatch, and is not compatible with newer versions.


pthread_workqueues

Installation - Linux

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib <path to source>
make
make install

Installation - Red Hat

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib <path to source>
make
cpack -G RPM

Installation - Debian

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/lib <path to source>
make
cpack -G DEB

Android

 cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=<path to NDK compiler> -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib <path to source>
 make

Windows (Visual Studio Project)

cmake -G "Visual Studio 14 2015" <path to source>
cmake --build .

Windows (clang/C2) (Visual Studio Project)

cmake -G "Visual Studio 14 2015" -T "LLVM-vs2014" <path to source>
cmake --build .

Xcode (project)

cmake -G "Xcode" <path to source>

Running Unit Tests

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DENABLE_TESTING=YES <path to source>
make
make test

libpwq's People

Contributors

bryanpkc avatar compnerd avatar dgrove-oss avatar frankeh avatar gonzalolarralde avatar ixce avatar johnno1962 avatar mheily avatar seabaylea avatar van-der-deken avatar ymanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libpwq's Issues

Hang in test-api test

I just started looking at libpwq and hit a hang in the test-api test. I'm running on Linux here:

(gdb) info threads
  Id   Target Id         Frame 
  4    Thread 0x7fbd90b33700 (LWP 12378) "lt-test_api" sem_timedwait () at ../sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S:101
  3    Thread 0x7fbd90332700 (LWP 12379) "lt-test_api" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 2    Thread 0x7fbd8fb31700 (LWP 12380) "lt-test_api" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  1    Thread 0x7fbda5f3b700 (LWP 12323) "lt-test_api" 0x00007fbda542191d in nanosleep () at ../sysdeps/unix/syscall-template.S:81

...it looks like the condition variable handling may be racy. It's possible for the worker thread to check for more work and not find any. Meanwhile, work is queued and the pthread_cond_signal is called. Then the worker goes to wait on the cond variable and never sees the signal.

ISTM that you need to hold the mutex that protects the cond variable when calling pthread_cond_signal to prevent that race.

pthread_atfork() deadlock with glibc 2.28

Since glibc 2.28, pthread_atfork() called in manager_init() deadlocks when re-entering from manager_reinit().

Reproducible with the following:

#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
    pid_t pid = fork();
    if (pid < 0) {
        perror("fork");
    } else if (pid > 0) {
        printf("parent, wait child\n");
        int status;
        waitpid(pid, &status, 0);
    } else {
        printf("child\n");
    }
    return 0;
}
% gcc a.c && ./a.out
parent, wait child
child
% gcc a.c -lpthread_workqueue && ./a.out
parent, wait child
<deadlock>

Question about building

Pardon me if this is not the correct place to ask, but:

 » cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/ <path to source>
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:151 (install):
  install FILES given no DESTINATION!


-- Configuring incomplete, errors occurred!
See also "/home/krak-n/Git/libpwq/CMakeFiles/CMakeOutput.log".
See also "/home/krak-n/Git/libpwq/CMakeFiles/CMakeError.log".

I'm not entirely sure what should be pointing to... Am I missing something glaringly obvious?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.