left behind. Since each request only uses 44 bytes, and as mentioned the ID's will eventua
get recycled, it will not be a huge memory loss. In general, even without this issue, it is strongly
lly
commended to not create and destroy a lot of threads. It is terribly slow and inefficient. Use
s
the middle of a call to this driver, more than likely a synchronization object will be left open on
evice and access to the device will be impossible until the application is
started. On some devices, it can be worse. On devices that have interprocess
he device
is restarted.
void using TerminateThread()! All device calls have a timeout, which defaults to 1 second, but
r the driver to finish.
re
thread pools and other techniques to keep new thread creation to a minimum. That is what i
done internally.
The one big exception to the thread safety of this driver is in the use of the Windows
TerminateThread() function. As is warned in the MSDN documentation, using
TerminateThread() will kill the thread without releasing any resources, and more importantly,
releasing any synchronization objects. If TerminateThread() is used on a thread that is currently
in
the particular d
re
synchronization, such as the U12, calling TerminateThread() may kill all access to t
through this driver no matter which process is using it and even if the application
A
can be changed. Make sure to wait at least as long as the timeout fo
47