|
|
|
CloseHandle блокируется
|
|||
|---|---|---|---|
|
#18+
Работаю с устройством через ком-порт. Алгоритм примерно следующий открытие и конфигурирование порта запись данных чтение ответа закрытие порта Такая процедура выполняется раз в минуту. В какой то момент программа повисает на CloseHandle Поискал вчера в MSDN и нашел маленькое уточнение авторA small caveat: closing the last handle to a file object counts as a synchronous I/O operation, and it will synchronize with other synchronous I/O operations if the file wasn't opened with FILE_FLAG_OVERLAPPED. Closing the last handle to a pipe, socket or other device that's being currently used in a synchronous I/O operation will block until the operation completes This is due to a small design oversight in the Windows I/O subsystem: the synchronous I/O lock of a file object isn't dropped before entering the wait for the operation's completion, causing the nesting of two locks and the potential for deadlocks In Windows Vista and later, CancelSynchronousIo can be used to interrupt and cancel stuck I/O operations Как я понимаю пишется о том что функция может залочится если не завершились какие-то операции ввода/вывода. Со 100% уверенностью могу сказать что мой запрос уходит в устройство, ответ я получаю в полном объеме и никаких незавершившихся операций быть не может. Соответственно, для прерывания в виста и более поздних предлагается использовать спец функцию. А что делать в Win 2000/XP? Заранее благодарен. Готов предоставить интересующие части исходных кодов. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.12.2008, 07:09:06 |
|
||
|
|

start [/forum/topic.php?fid=16&fpage=130&tid=1344755]: |
0ms |
get settings: |
6ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
60ms |
get topic data: |
8ms |
get forum data: |
3ms |
get page messages: |
31ms |
get tp. blocked users: |
1ms |
| others: | 210ms |
| total: | 337ms |

| 0 / 0 |
