IPC problems

Discussion in 'Cadence' started by Henrik Johansson, Sep 2, 2004.

  1. I'm trying to write an interface to Grace (a plotting tool) in SKILL.
    The communication with the Grace process is handled by SKILL's IPC
    functions.

    The new plot functions are working beautifully unless they sends too
    much data too fast to the child process. Since the ipcWriteProcess
    function is non-blocking I suspect that the data is buffered at the
    parent side when the child gets more data than it can chew. If the
    parent sleeps for a second and then sends another command to the child,
    the missing data is written out before the new command.

    Anyone know of a blocking alternative to ipcWriteProcess?

    Regards

    Henrik Johansson
     
    Henrik Johansson, Sep 2, 2004
    #1
  2. Hi Henrik,

    I'm not sure that would solve your problem. ipcWriteProcess() does an
    unbuffered write (or at least it flushes its buffers after a write) - but any
    data which is unread by the child would still be sitting there in the pipe
    waiting to be read, I'd have thought.

    It sounds like the problem is on the child side - the child is not correctly
    reading its input commands if a new command is sent whilst it is still
    processing.

    You may be able to get around this by getting the child to send something back
    to DFII (i.e. some sort of handshaking) so that your SKILL code doesn't try
    to send a command until it knows it is OK to do so.

    Or you may be able to put some kind of wrapper around grace (perhaps using
    expect?) to make it behave better?

    Andrew.
     
    Andrew Beckett, Sep 3, 2004
    #2
  3. First I wrote a wrapper in perl and it worked, but with each line being
    acknowledged it became very slow (like 3 lines per second).

    So I tried a different approach with named pipes instead. And now with
    the pipe handling the bufferering, things works perfectly. So if anyone
    is interrested in a Grace interface for Skill I can publish the code in
    the newsgroup.

    Regards

    Henrik
     
    Henrik Johansson, Sep 3, 2004
    #3
  4. Henrik Johansson

    Erik Wanta Guest

    Henrik:
    Please publish.
    ---
    Erik

     
    Erik Wanta, Sep 4, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.