[libdispatch-dev] libdispatch on VS 2008 and VS 2010 64bit

Mark Heily mark at heily.com
Wed Jun 15 19:38:22 PDT 2011


On 06/15/2011 02:02 AM, DrPizza wrote:
> I believe that if [4] were changed to read:
>
> dispatch_atomic_or(&ds->ds_pending_data, ke->data&  ds->ds_pending_data_mask);
>
> then support for 64-bit masks would be complete.
>

This would probably break the DISPATCH_SOURCE_TYPE_MACH_SEND and 
DISPATCH_SOURCE_TYPE_MACH_RECV source types, since they share the same 
codepath. You would have to add something like a 'ds_is_or' bitfield and do:

     } else if (ds->ds_is_or) {
         dispatch_atomic_or(&ds->ds_pending_data, ke->data);
     } else {
         /* Mach send or recv */
         dispatch_atomic_or(&ds->ds_pending_data, ke->fflags &
                                    ds->ds_pending_data_mask);
     }

Moreover, GCD has already shipped with the implicit limitation of 32-bit 
masks in MacOS 10.6 and probably in 10.7. If you extend the mask to 64-bits 
now, that breaks backwards compatibility. Since there are very few cases 
where a 64-bit mask would be useful, the cost of breaking compatibility 
outweighs the benefit.

I've attached a patch that documents the 32-bit limitation and adds an 
assertion that checks for a larger value.

Cheers,

  - Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libdispatch-custom_or_truncate.patch
Type: text/x-patch
Size: 1749 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/libdispatch-dev/attachments/20110615/70654d7e/attachment-0001.bin>


More information about the libdispatch-dev mailing list