Thread: Question...

  1. #1
    dizolve
    Guest

    Question...

    When you program a Win32 Application, does it only handle one thing at a time?

    Say, if I used SetTimer() to post a message every 30 seconds, and when the window received that timer message it would put up a message box. Would this timer/message box be paused if another function was executing?

    The reason I ask is that I'm doing things with linked lists, and I have a timer that triggers a function that searches through the list and deletes/adds things. Now, it wouldn't be good if a function was dealing with an object in the list and then the timer function went and deleted that object.

    Any help will be appreciated. Thank you.

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    I'm not sure what you are trying to do exactly, but I think what you should take a look at is threads. Try doing a search on google or looking at Petzold's Programming Windows book.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    70
    When you program a Win32 Application, does it only handle one thing at a time?
    When you have only one execution thread, and this is probably your case, only one thing at a time is performed.

    If you do this kind of design, you should have guaranteed that while manipulating with linked list, timer will not be triggered out. In another words, while executing timer handler assure yourself that the list is in quiet state, that is no action is performed on the list. I would use global BOOL variable that contained actual state of the list to do this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM