On 2012.05.04 23:44, Sean McBride wrote: >> Wouldn't that mean that OS-X would have different logging from other >> platforms? > > Seems it already does, no? Not all platforms have mach threads after all.
I'm talking about the log output. With the proposal, all platforms return an int => the libusb displays something like the following on all the systems we support: [ 0.123456] [00001ab2] libusbx: debug ... > pthread_getname_np() is available on many UNIXy platforms, but not always > with the same parameters. Not ideal I agree. Just pointing out options. I don't really have a preference, if we can an output that is similar across all platform. The WINE method of producing a cross-platform thread ID as an int is assumed tried and tested, so it would look the best to me right now, but the patch is still a proposal. >>> libusbx is already calling pthread_setname_np() for the thread it creates. >> >> But only for OS X I assume... > > I believe only on OS X does libusb ever create threads at all... Actually, Windows does create a thread for the timer, and in the future it is likely to create another one for hotplug ...but we're not adding thread IDs for the threads libusbx alone creates as that would be pretty pointless. We're doing this work for the ones multithreaded libusbx apps create. We've already encountered apps that split their operations between worker threads, and unless you can identify those, if 2 threads are initiating similar operations around the same time, troubleshooting can be a major headache. The whole point is really to help multithreaded libusbx app developers, who experience an issue, get some insight as to which thread is doing what. > Of note: the Xcode debugger GUI shows two thread identifiers: > - a number (dunno where it's from, maybe mach_thread_self even). I could > try to find this out... I think if we could get libusbx produce the same thread ID number as the debugger, it would probably help our users. If you can get that info, it would definitely be helpful. > Mac developers may appreciate that the same identifiers be shown by libusb. Yup. Regards, /Pete ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel