DEBUGMONITOR's threads?

May 20, 2008
10,551
78
Syracuse, NY, USA
When I do

Code:
debugmonitor 2 echo %%_outputdebugstring
I get two threads.

1581457657468.png


[It seems a bit funny that they have the same start address.] Anyway, when two strings have been reported, only one of those threads terminates. I can force the other to terminate with

Code:
debugmonitor /c
If I don't do that and execute "debugmonitor 2 ..." many times, I wind up with

1581458118202.png


And allowing more than one DEBUGMONITOR doesn't seem like a good idea. When they're all in the same TCC, you can't get rid of all the threads. If they're in different TCC's this happens (which is odd but expected).

1581458299925.png
 

rconn

Administrator
Staff member
May 14, 2008
11,910
133
That's not what's happening.

DEBUGMONITOR creates one thread. An additional thread gets created the first time you run one of the monitoring functions. (If you'll recall, you complained previously about that thread running when you hadn't run any monitoring commands, so it doesn't get created until it's actually needed.)
 
May 20, 2008
10,551
78
Syracuse, NY, USA
I don't understand your comment and I don't think I mis-observed or misspoke. I'll try again. In a new session, issue

Code:
debugmonitor 2 echo %%_outputdebugstring
Now I have this, two threads with the same address..

1581469285390.png


Provide 2 debug strings:

Code:
echo %@debug[foobar] & delay 1 & echo %@debug[foobar]
One of those threads exits.

1581469441414.png


Now issue

Code:
debugmonitor /c
The other thread at VScrput+0x1d210 exits (leaving no extra threads).

*****************************
Another one: run this btm in a new instance.

Code:
do i=1 to 4
    debugmonitor 2 `echo foo > nul`
    delay 1
    echo %@debug[foo] > nul
    delay 1
    echo %@debug[foo] > nul
    delay 1
enddo
When I run it I wind up with.

1581470010632.png
 
May 20, 2008
10,551
78
Syracuse, NY, USA
That's unlike (say) FOLDERMONITOR. After issuing

Code:
FOLDERMONITOR t:\ CREATED DELETED RENAMED MODIFIED 5 echo %%_foldertime %%_folderaction %%_folderfile
I have

1581471864249.png


When the N=5 transactions have been processed, BOTH of those threads terminate.
 
Thread starter Similar threads Forum Replies Date
V Support 1
S Support 3
S Support 6