Thread: How to handle in software to solve this block diagram?

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    54

    How to handle in software to solve this block diagram?

    Hello everyone:

    I have a block diagram as follow. Please help me to solve it.

    Code:
               DATA
               /    \
              /      \
       BufferA     BufferB
              \     /
               \___/
         ________|
        |        |
        |     Operation
        |        |
     N  |        |
        |      Work
        |________|
                 |
              Memory
    My problem is: I have 2 buffers and they are filled with data consecutively. After one buffer is fulled, the data will be passed and processed in Operation and Work while the other buffer is being filled. It takes 5ms to finish filling each buffer. There may be one Work runs at a time or N Works run at once. Make sure Work and Operation finish the N loop before doing Memory.
    I don't know how to handle this problem in C. Any of you may have any solution or suggestion, please tell me. I really appreciate!


    CODE TAGS added by Hammer
    Last edited by vnrabbit; 02-13-2003 at 10:24 AM.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    I added code tags to help keep the layout of your diagram. Try editing your post to fix the slight problems with the format.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    I do not fully understand your question. But you could define two pipes to put the data to. When a pipe is full, raise a signal or something like that (depends on your OS) and let the process which processes your data catch the signal and process the data.

    Here's a lot of info on IPC and related subjects:
    http://www.cs.cf.ac.uk/Dave/C/

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    54
    Hi Shiro,

    Thank you for responding. Your answer helps me to solve the first problem. My second problem is how to handle the loop N. Example, I have 1 Work runs at a time or 4 Works run in parallel. I don't know how to handle when the N loop is done so I can keep going to Memory operation. How to check if the N loop ends with a generic way. Thank you very much!

    P.S. Thank you very much Hammer for editting my post.

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    For running more than one thing at a time, check out the threads information on the link Shiro gave you.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Software Design/Test - Redmond, WA
    By IRVolt in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 06-11-2008, 10:26 AM
  2. Why C Matters
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 136
    Last Post: 01-16-2008, 09:09 AM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. Adding trial period to software
    By BobS0327 in forum C Programming
    Replies: 17
    Last Post: 01-03-2006, 02:13 PM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM