Thread: Concurrent programming in C++

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    105

    Concurrent programming in C++

    Greetings!

    I have problem which is more methodical, than syntactical this time. I have to make two concurrent functions. This will be something with serial communication. The task is the following:

    A function is running. It has to send a serial command, and WAIT for the answer. And when the answer comes, it has to process the incoming message.

    So my task is now to let Events occur while in an another function. Is there a command or anything which makes able a routine of an event run BEFORE an another routine has finished?

    In my task I use an infinite loop, which checks a flag. The flag is set in an another routine. Now my problem is that the first routine HAS to finish before the other routine would run.

    How can I solve this?

    Thx
    Han

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    105
    I use Windows XP, and Borland C++ Builder 5. I know the methodic of concurrent programming, and how I can realise it with tokens, sempahores, etc. But I don't know how does it look like in C++...I did something like this in Java, but that was quite different.

    I'd be glad if there'd be a "wait(bool token)" function (a "create(bool token)" ), and a "MultiThreadAllowed=true" function or like that.

    I'll look up the help, you've written.
    thx
    Han

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How To Initialize concurrent processes in C?
    By Matus in forum C Programming
    Replies: 4
    Last Post: 04-01-2009, 12:59 PM
  2. RPC concurrent server in C...???
    By mr_m4x in forum C Programming
    Replies: 1
    Last Post: 03-28-2009, 11:10 PM
  3. Concurrent Access and Databases.
    By indigo0086 in forum Tech Board
    Replies: 5
    Last Post: 05-23-2008, 11:39 AM
  4. Concurrent C
    By kris.c in forum C Programming
    Replies: 0
    Last Post: 04-13-2007, 07:00 PM
  5. Replies: 3
    Last Post: 05-07-2003, 05:16 PM