Search found 2342 matches

by coderJeff
Nov 30, 2020 12:42
Forum: Documentation
Topic: Wiki improvements
Replies: 555
Views: 99209

Re: Wiki improvements

About the new 'ThreadSelf' keyword: - I am surprised that under Windows the 'thread id' returned by 'ThreadSelf()' has the same value as the 'thread handle' returned by 'ThreadCreate()' (as under Linux). - If this is always true, then why use 2 different naming (the true naming should be 'thread ha...
by coderJeff
Nov 15, 2020 17:16
Forum: General
Topic: A short appraisal of Squares PRNG
Replies: 32
Views: 763

Re: A short appraisal of Squares PRNG

This is what I am using to randomly choose a key value. Neat, I didn't think about using rdtsc. I was just thinking about this problem. To seed the generators having something that changes every time. For the Squares PRNG seed I was thinking of using below with a default key only because it appears...
by coderJeff
Nov 15, 2020 16:48
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

That sounds good, adding 'fbmath.bi'

I just noticed there is also:
- 'fbio.bi' for IsRedirected
- 'fbthread.bi' for ThreadDetach
by coderJeff
Nov 15, 2020 12:25
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

what is this kind of thread-safe RANDOMIZE? There is still only one global state and only one generator can be selected at any one time across all threads. I would expect that the user would want to call the RANDOMIZE function before starting any threads. However, if for some reason RANDOMIZE were ...
by coderJeff
Nov 15, 2020 2:09
Forum: Documentation
Topic: RGB and RGBA
Replies: 7
Views: 1367

Re: RGB and RGBA

Shouldn't the return value be a ulong instead of uinteger? Following-up to this thread and bug ticket #924 RGB() & RGBA() macros return incorrect data-type Proposed is to return the ULONG type for RGB and RGBA macros. Timings depend on back end and optimization levels. For example, - 64-bit gcc...
by coderJeff
Nov 15, 2020 0:36
Forum: General
Topic: Strange error reporting with threadcall
Replies: 10
Views: 353

Re: Strange error reporting with threadcall

With commented sub procs lines --> 2 error messages ... When uncommenting sub procs lines --> only 1 error message That bug was tough to find though seems obvious now. parser-quirk-thread.bas:cThreadCallFunc() was using a wrong function to check if the procedure has a return type and was referring ...
by coderJeff
Nov 14, 2020 21:41
Forum: General
Topic: A short appraisal of Squares PRNG
Replies: 32
Views: 763

Re: A short appraisal of Squares PRNG

With these fast PRNG's, I think the general pattern is; Some state vector S: S = {x0, x1, ... } Some transition function f() to a new state S': S' = f(S) S'' = f(S') = f(f(S)) Maybe some extraction of the pseudo random number with bit-twiddling function g(): rnd := g(S) In either f() or g(), the mod...
by coderJeff
Nov 14, 2020 21:14
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

Well, I think we are on the right track with this change overall. 'fbmath.bi' needs some work to make it a little more user friendly and some updates to the documentation will help advertise it. fxm, sorry, I didn't mean to turn this in to a development discussion. For sure, we can update the follow...
by coderJeff
Nov 14, 2020 20:48
Forum: Community Discussion
Topic: Where can I get a Recent-Git-Build of FreeBASIC?
Replies: 487
Views: 82368

Re: Where can I get a Recent-Git-Build of FreeBASIC?

Sorry about that. Sometime in last months Travis-CI changed the default build environment - previously Ubuntu 14.04 Trusty which uses gcc 4.8.4. - currently Ubuntu 16.04 Xenial which uses gcc 5.4.0 I have only been testing on Ubuntu 16.04 x86_64 lately. An easy fix though and should have it pushed s...
by coderJeff
Nov 14, 2020 19:29
Forum: Community Discussion
Topic: What happened to the Emscripten branch?
Replies: 79
Views: 2955

Re: What happened to the Emscripten branch?

I've rebased and pushed changes to https://github.com/jayrm/fbc/tree/emscripten including the patches posted in this topic from angros47 I tested on windows x86_64 only. One issue and work-around (hack) is below. Prerequisites - git installed - development environment for fbc, rtlib, & gfxlib2 -...
by coderJeff
Nov 07, 2020 13:03
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

I've merged new changes with https://github.com/freebasic/fbc/pull/267 It adds the new header ./inc/fbmath.bi that has the new PRNG's. I'm hoping that with the source in fb itself there will be contributors from the community that can expand on the very simple starting point. I'll update this thread...
by coderJeff
Nov 06, 2020 22:08
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

Naming of "rnd64()" looks good to me. I can add xoroshiro128 to fbmath.bi header also. Maybe tonight. At first I was seeing truly mind boggling timings with xoroshiro128. Like it defied reality. ...Evidently, if seeded with {0,0}, seems that gcc optimizes xoroshiro128 out of existence. :) ...
by coderJeff
Nov 06, 2020 0:32
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

The gcc optimizations didn't work out the way I thought. So I need to regroup and figure out my exit strategy. fbc 1.07 is neither thread-safe nor has rnd32. So my base line test timings are limited. On -O2 production code built-in RND() - it doesn't really matter much if it is gas or gcc because it...
by coderJeff
Nov 03, 2020 4:25
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

Thanks paul. I'm kind of happy with last rewrite. It has some generic qualities so it will be easy to add in additional generators. But the performance is still bad due the function pointers, by like a factor of 10. namespace fbc extern "rtlib" type RndMSWS32 extends FB_RNDSTATE declare co...
by coderJeff
Nov 03, 2020 1:51
Forum: Documentation
Topic: Threadsafe RANDOMIZE and RND
Replies: 57
Views: 1904

Re: Threadsafe RANDOMIZE and RND

@coderjeff: You can always implement them as header files, and then the user can #include them as they see fit. All you have to do is include it as part of the currently official distribution. No compiler bloat, faster error reporting and correcting, easily patchable and modifiable... I have an ide...

Go to advanced search