Non-blocking i/o in VxWorks - VxWorks

This is a discussion on Non-blocking i/o in VxWorks - VxWorks ; Hi all, Does anybody know of any non blocking i/o libraries on vxworks? I am asking because my tasks are getting prempted when i use printf() or logMsg(), which are blocking i/o calls. bye....

+ Reply to Thread
Results 1 to 5 of 5

Thread: Non-blocking i/o in VxWorks

  1. Non-blocking i/o in VxWorks

    Hi all,
    Does anybody know of any non blocking i/o libraries on vxworks?
    I am asking because my tasks are getting prempted when i use printf()
    or logMsg(), which are blocking i/o calls.
    bye.


  2. Re: Non-blocking i/o in VxWorks

    On Aug 6, 5:11 am, Rahul wrote:
    > Hi all,
    > Does anybody know of any non blocking i/o libraries on vxworks?
    > I am asking because my tasks are getting prempted when i use printf()
    > or logMsg(), which are blocking i/o calls.
    > bye.


    I don't know of any non-blocking i/o libraries on vxworks, but I've
    used another low priority task to handle all the printf and log
    messages. You can use a pipe and/or shared memory to send the printf
    string to the low priority task. Hope this helps.


  3. Re: Non-blocking i/o in VxWorks

    On Aug 8, 8:49 pm, bghs wrote:
    > On Aug 6, 5:11 am, Rahul wrote:
    >
    > > Hi all,
    > > Does anybody know of any non blocking i/o libraries on vxworks?
    > > I am asking because my tasks are getting prempted when i use printf()
    > > or logMsg(), which are blocking i/o calls.
    > > bye.

    >
    > I don't know of any non-blocking i/o libraries on vxworks, but I've
    > used another low priority task to handle all the printf and log
    > messages. You can use a pipe and/or shared memory to send the printf
    > string to the low priority task. Hope this helps.


    Use "logMsg".Basically it does same as mentioned in the above post :
    another low priority task at other end of a msgQ, just that it is a
    library function.
    Cheers.


  4. Re: Non-blocking i/o in VxWorks

    PrintMsg(arguments....................)
    {
    taskLock(.....) ; //A taskLock( ) is preferable to intLock( ) as
    a means of mutual exclusion, because interrupt lock-outs add interrupt
    latency to the system
    printf(" do your printf here ");
    taskUnlock() ;

    }

    The task that calls this PrintMsg function does not get premepted
    untill this task explicityl gives up the CPU by making itself no
    longer ready.



    taskLock routine disables task context switching. The task that calls
    this routine will be the only task that is allowed to execute, unless
    the task explicitly gives up the CPU by making itself no longer ready.
    Typically this call is paired with taskUnlock( ); together they
    surround a critical section of code. These preemption locks are
    implemented with a counting variable that allows nested preemption
    locks. Preemption will not be unlocked until taskUnlock( ) has been
    called as many times as taskLock( ).

    This routine does not lock out interrupts; use intLock( ) to lock out
    interrupts.

    A taskLock( ) is preferable to intLock( ) as a means of mutual
    exclusion, because interrupt lock-outs add interrupt latency to the
    system.

    A semTake( ) is preferable to taskLock( ) as a means of mutual
    exclusion, because preemption lock-outs add preemptive latency to the
    system.

    The taskLock( ) routine is not callable from interrupt service
    routines.




    On Aug 6, 5:11 pm, Rahul wrote:
    > Hi all,
    > Does anybody know of any non blocking i/o libraries on vxworks?
    > I am asking because my tasks are getting prempted when i use printf()
    > or logMsg(), which are blocking i/o calls.
    > bye.




  5. Re: Non-blocking i/o in VxWorks

    On Aug 15, 3:18 am, visu wrote:
    > PrintMsg(arguments....................)
    > {
    > taskLock(.....) ; //A taskLock( ) is preferable to intLock( ) as
    > a means of mutual exclusion, because interrupt lock-outs add interrupt
    > latency to the system
    > printf(" do your printf here ");
    > taskUnlock() ;
    >
    > }
    >
    > The task that calls this PrintMsg function does not get premepted
    > untill this task explicityl gives up the CPU by making itself no
    > longer ready.
    >
    > taskLock routine disables task context switching. The task that calls
    > this routine will be the only task that is allowed to execute, unless
    > the task explicitly gives up the CPU by making itself no longer ready.


    I think a little clarification is in order here.
    There is such a thing as inadvertent or unintentional blocking -- by
    calling a function that blocks, and printf() is one such function.
    If a task calls taskLock() and then calls printf(), there is good
    chance that printf() will block.
    In this case, the scheduler will then be temporarily re-enabled until
    the blocking call unblocks.

    HTH
    GV





+ Reply to Thread