I’m working a service that have to deal with files, however the code that treats each file might froze (i don’t have any authority on this since the work is done from a third party library).
To ensure that my service won’t froze, i wanted to do the treatment for a certain amout of time in a separate thread and stop it whenever a timeout is reached.
I’m not sure if i still can use thread.abort in .net6 so i thought about using Task, however i don’t know if i can kill forcefully a task.
Since the code might froze, i can’t use any cancellationToken because i wouldn’t be able to read it.
I don’t think i can let an increasing amount of tasks stack up so i was wondering if you had any clue ?
Sincerely.