Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Upcoming OSR Seminars:
Kernel Debugging & Crash Analysis for Windows Lab, Santa Clara, CA 9-13 September, 2013
Upcoming OSR Seminars:
Windows Internals & Software Drivers Lab, Santa Clara, CA 16-20 September, 2013
Writing WDF Drivers for Windows Lab, Boston/Waltham, MA 7-11 October, 2013
Developing File Systems for Windows, Seattle, WA 5-8 November, 2013


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 3  
27 Apr 12 15:26
Frank Jenner
xxxxxx@cspeed.com
Join Date: 27 Jan 2012
Posts To This List: 38
WdfUsbTargetPipeWriteSynchronously thread safety

When writing data to a USB endpoint using WdfUsbTargetPipeWriteSynchronously, is there any guarantee that all of the data pointed to by the MemoryDescriptor parameter will be written to the USB endpoint atomically, or is it possible that concurrent calls to WdfUsbTargetPipeWriteSynchronously to the same endpoint could cause data to be interleaved? My assumption is that, since the memory is contained in a single request to the USB pipe I/O target, the request will be queued up by the I/O target and processed one-at-a-time. On the other hand, if my assumption is wrong, I will surely want to have locks around any such calls to WdfUsbTargetPipeWriteSynchronously.
  Message 2 of 3  
27 Apr 12 16:00
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 8350
RE: WdfUsbTargetPipeWriteSynchronously thread safety

The memory of the two write requests will not beinterleaved on the usb wire, but the order in which the 2 write calls are processed is not deterministic. If two threads call WriteSynchronously at the same time,d oes it matter if the order is non deterministic? Are the writes stateful? -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@cspeed.com Sent: Friday, April 27, 2012 12:26 PM To: Windows System Software Devs Interest List Subject: [ntdev] WdfUsbTargetPipeWriteSynchronously thread safety When writing data to a USB endpoint using WdfUsbTargetPipeWriteSynchronously, is there any guarantee that all of the data pointed to by the MemoryDescriptor parameter will be written to the USB endpoint atomically, or is it possible that concurrent calls to WdfUsbTargetPipeWriteSynchronously to the same endpoint could cause data to be interleaved? My assumption is that, since the memory is contained in a single request to the USB pipe I/O target, the request will be queued up by the I/O target and processed one-at-a-time. On the other hand, if my assumption is wrong, I will surely want to have locks around any such calls to WdfUsbTargetPipeWriteSynchronously. --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  Message 3 of 3  
27 Apr 12 16:09
Frank Jenner
xxxxxx@cspeed.com
Join Date: 27 Jan 2012
Posts To This List: 38
RE: WdfUsbTargetPipeWriteSynchronously thread safety

Thanks! In this application, the memory provided for each call is a self-describing "packet", and the order in which these packets are written does not matter, so long as each one makes it out to the wire uninterrupted.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 01:49.


Copyright ©2012, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license