CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Is it an event?

  1. #1
    Join Date
    Apr 2002
    Posts
    61

    Is it an event?

    HI all,

    I'm trying to create something like a virtual circuit. I create a series of objects and link them to one another withe what each object understands to be the input and the output. Now I was trying to figure out how to get all of these objects to run one clock cycle (this is not real time so they do not have to run parrallel). My idea was to have each object have a tick function and then a master tick function that calls them all. I don't really like this because what I'd like is to be able to do is have each object with a pointer to a "clock" that it waits for. This sounds to me like a thread waiting for a mutex but I'm not sure how to get every one to run once and only once when I unlock the mutex. Am I looking at this all wrong or is ther just something I'm forgetting?

    BTW I'm not using spice because I'm sumulating whole devices interacting (IE HBA to DMA to CPU to RAM to DISK etc.) Besides it might be fun to get this working.
    thanks,
    Devan

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757

    Re: Is it an event?

    So what's the question? You need ideas for a better design, correct?

    Kuphryn

  3. #3
    Join Date
    Apr 2002
    Posts
    61

    Re: Is it an event?

    Basically. I'm looking for an opinion on the best method for simulating the data stream

  4. #4
    Join Date
    Feb 2002
    Posts
    5,757

    Re: Is it an event?

    One possible solution is an event. A thread represents a wire. When the master control sets an event, each thread be get a scheduled CPU time. There will always be delay because you are simulating this on a single CPU.

    Kuphryn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured