>> And to delete the ?orphan?threads, that which the user fired but leave the page...
it's not possible to do - because you can't tell that the user has "left the page".
>> How about a Memory file, adding a record when starting the proc, saving the sessionID and threadNr which fires it, and inside the proc, in the loop reading the map points, fetch if there are a record with this sessionID and different threadNr, and then kill the tread?
Under what circumstances would the memory file record be removed though. You don't get a notification that the user left the page, so....
If you really wanted to do this you could do some complicated scheme with the progress bar - if the user left the page then the progress requests would stop, and so the memory line could "time out".
Or alternatively you could put a web socket on the page, so as long as the web socket is open the connection is there, if the web socket closes then you st something so the thread knows to end.
>> Or notify all threads that IM begining the process using a sessionID and inside the proccess if I have the same SessionID then kill the process.
>> BTW, hows the best way to kill the tread?
you don't kill a thread from outside. You set a global flag, which the thread is monitoring, and if the flag is set then it kills itself.
>> This could be a feature in NT14 !
Maybe. Sounds complicated and prone to failure, but maybe.
cheers
Bruce