Thread: WakeUp program

  1. #1
    Registered User
    Join Date
    Nov 2001

    Lightbulb WakeUp program


    Is there something in C++ that allows the main() program to sleep and only wakeup if there is data on the scoket ?

    I work on VMS using ANSI C++. In the old days I would write a C program with a main() containing a SYS$HIBER() call which bascially allows the main to hibernate until a sys$wake() call is made.

    I would write TCP/IP routines using QIO, and when data arrived on the socket, an AST would fire and call sys$wake() to wake the main program. The problem is - this style of programming will only work on VMS.

    I'm trying to write a new program in C++ that runs on VMS but is more portable. What can I use to allow the main program to sleep whilst there is nothing to do, and what can I use on the socket side to notify main() it has data to process ? Remember I work on a VMS platform so only ANSI C++ stuff may be used.

    Thanks in advance for your help

  2. #2
    Registered User
    Join Date
    Nov 2001

    I know that would work, but I must admit it's my fault for not being clear !!

    My main program is both a client and server, which is why I cannot have blocking reads. The main program must be free to process commands at all times, it cannot block on reads or write !


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  2. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM