WakeUp program

This is a discussion on WakeUp program within the C++ Programming forums, part of the General Programming Boards category; Hi Is there something in C++ that allows the main() program to sleep and only wakeup if there is data ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    6

    Lightbulb WakeUp program

    Hi

    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
    Kwoky

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    6
    Salem

    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 !

    Cheers
    Kwoky

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, 12:41 PM
  2. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  3. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21