Page 4 of 4 FirstFirst 1234
Results 31 to 33 of 33

Thread: Am I the first webapp of the pool?

  1. #31
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Am I the first webapp of the pool?

    Sture

    I've just checked under 20.1 and it seems OK, however I wouldn't go so far as to say we "know".

    Ask the guys who wrote it.

    Mike

  2. #32
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    5,446

    Default Re: Am I the first webapp of the pool?

    You may try using MUTEX objects...

    Mutex Objects - Win32 apps | Microsoft Docs

    for each different webapp project, you create a named mutex,

    The 1st process starting by the pool will be able to create such mutex, and own it..
    all the others will fail. so you get your 1st app

    Same also may help you when the Pool is being recycled..
    When the 1st process is terminated by Webapp Admin, you can release the mutex normally, but even if your process crashes.. the mutex is considered ABANDONED, and the next process that tries to own it , will succeed.

    I used mutex objects is the past, to avoid regular windows DF Apps to be started more than one. If the user have already started one instance of the applications, he/she was not allowed to start a second one.. the mutex creation failed, and I terminated the app upon start-up time

    So I remember this could also be used for your need..

    Regards
    Samuel Pizarro

  3. #33
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Am I the first webapp of the pool?

    Just noticed... in cFirstWebAppProcessChecker.pkg (lines 20-26):

    Code:
    #IFNDEF get_ProcessHandle
    External_Function ProcessHandle "OpenProcess" Kernel32.DLL ;
        DWord   dwDesiredAccess ;
        Boolean bInheritHandle ;
        DWord   dwProcessID ;
        Returns Handle
    #ENDIF
    Is redundant - duplicated by OpenProcess just above it (and indeed total b0110cks! ).

    Mike

Page 4 of 4 FirstFirst 1234

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •