Thread: POSIX threads

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    Question POSIX threads

    In a plugin I run several threads. However, the program that the plugin accesses is single threaded. I need a way to call functions in the program from the 'main' thread, not the new threads. I can't find a POSIX function (pthread) that allows me to call a function in the main thread from the child thread.

    Does anyone know of a function?

    Thanks.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    There is none. Pthreads doesn't have call injection. All you can do is queue up whatever you want to do and wait for the main thread to call your plugin again, then handle all the calls back into the program.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    2
    Oh well

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. POSIX Threads and dynamic memory allocation
    By PING in forum Linux Programming
    Replies: 1
    Last Post: 04-02-2009, 10:28 AM
  2. Using POSIX threads in C on Linux
    By muthus in forum C Programming
    Replies: 1
    Last Post: 01-19-2008, 05:34 PM
  3. POSIX threads policy and priority
    By arunj in forum Linux Programming
    Replies: 2
    Last Post: 06-13-2006, 03:48 AM
  4. pthreads-win32 POSIX threads
    By c99 in forum C Programming
    Replies: 4
    Last Post: 02-24-2004, 06:59 PM
  5. compile prob: sched.h (win32 POSIX threads) - pid_t
    By BrianK in forum Windows Programming
    Replies: 6
    Last Post: 04-11-2003, 05:52 PM

Tags for this Thread