>> We call a method in the C++ DLL (from javascript) to do a long procedure.
>> ... and the method returns to firefox as a non-blocking function call.
It sounds like you'll have to make a 2nd,...
What is the main thread doing while the compute thread is computing? Does it "return" to the caller? Is it blocked? Is it in a message loop (that your wrote)?
If you can't get an EXE-import-lib to work (I'm not sure if it is possible), then you're down to two options:
1) Manually link the EXE's symbols with GetProcAddress() (or through dlfcn-win32)
2)...
Windows does not support "automatic reverse dynamic linking" - or in other words, what you get on Linux when the app is compiled with "-rdynamic" (or "--export-dynamic").
>> non-technically speaking ...
Thanks for the English version. The thought experiment of reducing [1,3] to [1,2] (or [0,5] to [0,3]) is what I'm used to seeing when explaining why a mathematically...
>> ... if and only if ...
That's Greek to me. Does it have a name? Or where can I read about it more?
Proof jargon aside, isn't "uniformity" just a subjective measurement in this case, including...
>> What I meant is if you have a random distribution from 0-R exclusive, then neither your method of multiplying and clipping nor modulo will give a uniform distribution over 0-M if M is not a factor...
>> Because of the +0.5 correction ...
You are correct. Simply multiplying by 256 is the right thing to do and will give a true uniform distribution over [0, 255]. It was easy to confirm as well:
When two or more threads access the same memory location where at least one thread is modifying the memory, then all accesses must be synchronized using primitives from your threading library.
>> The potential modulo bias is still there.
*sigh* I can't explain things any better than the links I've already posted. If you don't believe the experts from the Usenet posts I linked to, then...
>> So even if the random number you get from rand() is uniformly distributed the individual bits may not be for certain.
I'm no mathematician, and I couldn't find an authoritative answer online. My...
>> If you use modulo N to "cap" it, a small non-uniformity will sneak in.
This statement is only true under the following assumptions:
- the PRNG returns uniformly distributed numbers within some...
I wish I could help more, but this thread and the other represent my only exposure to CAN bus programming. In other words, I'm just pulling what I can from the manuals.
>> I don't quite understand the nature of your objection.
>> ... uniformly distributed number withing the full range of a positive 32 bit int.
My objection is that it's not a uniform distribution -...
>> That will give you a random uniformly distributed number withing the full range of a positive 32 bit int.
That doesn't seem correct to me. For example, to get a number between 0 and 127, rand()...