Multithreading and PlugIns

This is a discussion on Multithreading and PlugIns within the C++ Programming forums, part of the General Programming Boards category; Hi all In my new project i want to load PlugIns and run them in a seperate thread each. Now ...

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    21

    Multithreading and PlugIns

    Hi all

    In my new project i want to load PlugIns and run them in a seperate thread each. Now designing my PulgIn architecture i came up with the question where to put the ThreadCall function? Is it better to put it in the Core or in each PlugIn itself so when instanciated the plugin creates a thread and runs its functions?

    Thanks in advance

    Ghostcoder

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    Presumably, you've also designed a communication mechanism that alllows the core to communicate with each plugin thread.

    If you want to force it to be a thread, then you should do it yourself in the core.

    But maybe there are certain simple plugins where a thread would be an excessive solution.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    21
    thank you for your advice.

    indeed i designed a stack system to let the core cummunicate with the plugin and the other way round.
    but back to the topic i think ill put some kind of white list into the core to decide if the plug in needs a thread or not.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21