• Using Prf* routines in wi

    From Ian Moote@1:244/140 to VITUS JENSEN on Sun Jun 4 04:16:00 2000
    Does anybody know whether Prf* routines are usable from inside a
    window proc? Do they block or violate the 1/10s rule in any
    other way?

    What's the "1/10's rule"? TIA and TTYL.

    ---
    ■ Grape Nuts: No grapes. No nuts! What's the deal?

    --- AdeptXBBS v1.11y (FREEWare/2)
    * Origin: Moote Pointe (1:244/140)
  • From MIKE RUSKAI@1:3603/140 to IAN MOOTE on Mon Jun 5 13:41:00 2000
    Some senseless babbling from Ian Moote to Vitus Jensen
    on 06-04-00 11:16 about Using Prf* routines in wi...

    Does anybody know whether Prf* routines are usable from inside a window proc? Do they block or violate the 1/10s rule in any
    other way?

    What's the "1/10's rule"? TIA and TTYL.

    A window procedure which is run while PM is waiting is supposed to return control within 1/10th of a second, so that the system response doesn't
    suffer. Anything that takes more than that period of time to accomplish
    should be done on a second thread.

    Mike Ruskai
    thannymeister@yahoo.com


    ... I am TIM the Enchanter, but you can call me Tim.

    ___ Blue Wave/QWK v2.20
    --- Platinum Xpress/Win/Wildcat5! v3.0pr3
    * Origin: Get all your fido mail here.. www.docsplace.org (1:3603/140)
  • From Ian Moote@1:244/140 to MIKE RUSKAI on Wed Jun 7 14:27:00 2000
    What's the "1/10's rule"? TIA and TTYL.

    A window procedure which is run while PM is waiting is supposed to
    return control within 1/10th of a second, so that the system
    response doesn't suffer. Anything that takes more than that period
    of time to accomplish should be done on a second thread.

    Ahh! I was wondering how one decides what _should_ be moved out of the WndProc() and into seperate threads. Very useful! Thanks a lot, Mike!
    Take care and TTYL.

    ---
    ■ A woman's guess is more accurate than a man's certainty.

    --- AdeptXBBS v1.11y (FREEWare/2)
    * Origin: Moote Pointe (1:244/140)
  • From Vitus Jensen@2:2474/424.1 to Ian Moote on Wed Jun 7 17:55:10 2000
    Moin Ian,

    04.06.00 11:16, Ian Moote wrote a message to VITUS JENSEN:

    Does anybody know whether Prf* routines are usable from
    inside a
    window proc? Do they block or violate the 1/10s rule in any
    other way?

    What's the "1/10's rule"? TIA and TTYL.

    What's "TIA" and "TTYL"?

    The "1/10's rule" is a rule of thumb when it comes to presentation manager programming. It says that your window procedure should return within 0.1s to keep the user interface responsive.

    The chosen interval comes from ancient ages when a 80486DX33 was a fast processor (and everyone used to those speeds) so today the rule should be formulated a little different. Let's try it:

    "You should not spend a considerable amount of time inside the window procedure. Don't use APIs which may block (as the duration of the block is not
    predictable in a multitasking system), don't access files or devices (access may fail and have a long timeout), and don't do lengthy operations (like filling a large listbox)."

    By[t]e,
    Vitus

    ---
    * Origin: Request VRAID - Software RAID for OS/2! (2:2474/424.1)
  • From Vitus Jensen@2:2474/424.1 to MIKE RUSKAI on Mon Jun 19 19:05:30 2000
    Moin MIKE,

    17.06.00 19:22, MIKE RUSKAI wrote a message to VITUS JENSEN:

    Some senseless babbling from Vitus Jensen to Coridon Henshaw
    on 06-08-00 00:43 about Using Prf* routines in wi...

    [snip]

    But even if the user selected a network drive it would hang the
    PM if the network fails and my program uses
    PrfWriteProfileData() from WM_MOVE.

    In my book, any function which can potentially block for an
    indefinite amount of time belongs in a second thread.

    So is my coding style. I just wanted to confirm that PrfRead/Write do access the file (and block). This isn't obviously given the Prf* docu and looking at the strategy used by WPS to rewrite os2.ini.
    I take it that you think about Prf* as /blocking/?

    So, instead of calling the Prf*() functions from your window
    procedure, create a wrapper for all the functions you need, which
    call the API's on a second thread (I recommend a wrapper simply
    to avoid clutter in the window procedure).

    The design is up to me but using a second thread is a possibility.

    Bye,
    Vitus

    --- Sqed/rexx 436:
    * Origin: Remember, Speed kills! Try Windows to relax (2:2474/424.1)
  • From Ian Moote@1:244/140 to VITUS JENSEN on Fri Jun 23 16:23:00 2000
    Sorry for the delay. The feed's been down here for a couple of weeks.


    What's the "1/10's rule"? TIA and TTYL.

    What's "TIA" and "TTYL"?

    "Thanks In Advance" and "Talk To You Later". [:)


    The "1/10's rule" is a rule of thumb when it comes to presentation
    manager programming. It says that your window procedure should
    return within 0.1s to keep the user interface responsive.

    The chosen interval comes from ancient ages when a 80486DX33 was a
    fast processor (and everyone used to those speeds) so today the rule
    should be formulated a little different. Let's try it:

    "You should not spend a considerable amount of time inside the
    window procedure. Don't use APIs which may block (as the duration
    of the block is not predictable in a multitasking system), don't
    access files or devices (access may fail and have a long timeout),
    and don't do lengthy operations (like filling a large listbox)."

    I've seen that kind of stuff mentioned before. And this is why all of
    those functions should be relegated to threads? So, really when you look
    at it, in nearly all cases the window procedure is little more than a
    thread dispatcher, which is why you want to try to keep it clear. Is
    that about right?

    Take care and TTYL.

    ---
    ■ Change is good. Folding money is better.

    --- AdeptXBBS v1.11y (FREEWare/2)
    * Origin: Moote Pointe (1:244/140)
  • From MIKE RUSKAI@1:3603/140 to IAN MOOTE on Sat Jun 24 08:35:00 2000
    Some senseless babbling from Ian Moote to Vitus Jensen
    on 06-23-00 23:23 about Using Prf* routines in wi...

    [snip]
    "You should not spend a considerable amount of time inside the
    window procedure. Don't use APIs which may block (as the duration
    of the block is not predictable in a multitasking system), don't
    access files or devices (access may fail and have a long timeout),
    and don't do lengthy operations (like filling a large listbox)."

    I've seen that kind of stuff mentioned before. And this is why all of those functions should be relegated to threads? So, really when you
    look at it, in nearly all cases the window procedure is little more
    than a thread dispatcher, which is why you want to try to keep it
    clear. Is that about right?

    Sort of. The window procedure should do everything necessary to maintain
    the window itself, short of long paints (which should be done on a separate thread), and dispatch threads for the real work. Ideally, that is.

    One way of making that easier is to set up a second message queue, that
    doesn't have a window associated with it, which receives all messages from
    the main window procedure via WinPostMsg() that aren't to be done in that
    main procedure.

    Mike Ruskai
    thannymeister@yahoo.com


    ... HAL 9000: Help me, Dave. I can't run under Windows, Dave.

    ___ Blue Wave/QWK v2.20
    --- Platinum Xpress/Win/Wildcat5! v3.0pr3
    * Origin: Get all your fido mail here.. www.docsplace.org (1:3603/140)
  • From Vitus Jensen@2:2474/424.1 to Ian Moote on Sat Jun 24 09:40:31 2000
    Moin Ian,

    23.06.00 23:23, Ian Moote wrote a message to VITUS JENSEN:

    What's the "1/10's rule"? TIA and TTYL.
    What's "TIA" and "TTYL"?
    "Thanks In Advance" and "Talk To You Later". [:)

    Oh, nice to know!


    The "1/10's rule" is a rule of thumb when it comes to presentation
    manager programming. It says that your window procedure should
    return within 0.1s to keep the user interface responsive.

    The chosen interval comes from ancient ages when a 80486DX33 was
    a fast processor (and everyone used to those speeds) so today the
    rule should be formulated a little different. Let's try it:

    "You should not spend a considerable amount of time inside the
    window procedure. Don't use APIs which may block (as the
    duration of the block is not predictable in a multitasking
    system), don't access files or devices (access may fail and have
    a long timeout), and don't do lengthy operations (like filling a
    large listbox)."

    I've seen that kind of stuff mentioned before. And this is why
    all of those functions should be relegated to threads? So, really
    when you look at it, in nearly all cases the window procedure is
    little more than a thread dispatcher, which is why you want to
    try to keep it clear. Is that about right?

    I think, that's really the conclusion one should take. If a message can be handled in some Win* calls (or some more in WM_INITDLG when you have to setup the dlgbox) do it from inside the window procedure. If it's more then think about threads.
    Nevertheless, given the amount of messages which could be interesting for a window this may give a fairly large procedure.

    Bye,
    Vitus

    --- Sqed/rexx 85:
    * Origin: When DOS grows up it wants to be OS/2! (2:2474/424.1)
  • From Ian Moote@1:244/140 to MIKE RUSKAI on Fri Jul 28 13:49:00 2000
    Sorry for the lengthy delay. My host was down for a couple of weeks,
    then I got busy here in the shop and in my personal life.


    Sort of. The window procedure should do everything necessary to
    maintain the window itself, short of long paints (which should be
    done on a separate thread), and dispatch threads for the real work. Ideally, that is.

    One way of making that easier is to set up a second message queue,
    that doesn't have a window associated with it, which receives all
    messages from the main window procedure via WinPostMsg() that aren't
    to be done in that main procedure.

    That would also require its own thread to process the messages on the
    second queue? Would I be correct in understanding that this is just a "technique" thing, something that you would do just to give the program
    more structure so that it behaves in a more logical fashion, but which
    does not really benefit the user of the program in a noticeable or
    practical way? (I'm not trying to sound critical here, just trying to understand where the suggestion is coming from.)

    Take care and TTYL.

    ---
    ■■ Win'9x: 32-bit beauty that's only skin-deep.

    --- AdeptXBBS v1.11y (FREEWare/2)
    * Origin: Moote Pointe (1:244/140)
  • From MIKE RUSKAI@1:3603/140 to IAN MOOTE on Tue Aug 1 08:31:00 2000
    Some senseless babbling from Ian Moote to Mike Ruskai
    on 07-28-00 20:49 about Using Prf* routines in wi...

    Sorry for the lengthy delay. My host was down for a couple of weeks,
    then I got busy here in the shop and in my personal life.

    Sort of. The window procedure should do everything necessary to
    maintain the window itself, short of long paints (which should be
    done on a separate thread), and dispatch threads for the real work. Ideally, that is.

    One way of making that easier is to set up a second message queue,
    that doesn't have a window associated with it, which receives all
    messages from the main window procedure via WinPostMsg() that aren't
    to be done in that main procedure.

    That would also require its own thread to process the messages on the second queue? Would I be correct in understanding that this is just a "technique" thing, something that you would do just to give the
    program more structure so that it behaves in a more logical fashion,
    but which does not really benefit the user of the program in a
    noticeable or practical way? (I'm not trying to sound critical here,
    just trying to understand where the suggestion is coming from.)

    Yes, it would execute on its own thread. And yes, it is a technique, the
    point of which is to make the program noticeably better behaved.

    Mike Ruskai
    thannymeister@yahoo.com


    ... Ah, Camelot. <It's only a model> Shhhh!

    ___ Blue Wave/QWK v2.20
    --- Platinum Xpress/Win/Wildcat5! v3.0pr3
    * Origin: Get all your fido mail here.. www.docsplace.org (1:3603/140)