hi,
i had this issue with aborting thread:
my separate thread was generating bitmap thumbnails from larger bimap
files. when i was aborting this thread it sometimes happened that bitmap
objects were not disposed immediately, so i ended up with 200-300 megs
of memory ussage.
someone suggested that i should create some sort of stop signal value
which is frequently checked by the thread. if the value is set to true
then thread skips all its job and exits.
this works well but has one problem - if operation performed by thread
is very time consuming, like reading or writing large files or
resampling bimaps *AND* this is done in one line of code, then you cant
cancel this operations with metioned stop signal. so you may end up
waiting for the operation to finish. offcourse with stop signal you end
up with clean exit (you can free all resources), but you cant cancel a
single operation this way.
and for that i didn't found a sollution :(
am wrote:
Hi to all.
I have a little problem. I'm working with threads, and I need to abort
or suspend them, but many experts dissuade from use Thread.Abort and
Thread.Suspend. As I didn't find other way, how can I do?
Thanks a lot!