Search found 10215 matches

by fxm
Feb 26, 2021 21:54
Forum: General
Topic: is redim inside threads safe? ( memory leak help :O, ) (SOLVED)
Replies: 14
Views: 450

Re: is redim inside threads safe? ( memory leak help :O, ) (SOLVED)

If 'Dir' is thread-safe (because of using TLS memory), mutex usage is useless whatever the instruction sequence calling 'Dir'.

adeyblue wrote:Dir is one of the four explicitly thread safe things in FB.
Can you expand a bit?
by fxm
Feb 26, 2021 19:20
Forum: General
Topic: is redim inside threads safe? ( memory leak help :O, ) (SOLVED)
Replies: 14
Views: 450

Re: is redim inside threads safe? ( memory leak help :O, ) (SOLVED)

It does not surprise me that 'Dir' is not thread safe. To get a list of items in a directory, 'Dir' must be called multiple times (because returning only one item per call) in a section of code (multiple lines of code). So to avoid any conflict with another thread using 'Dir'...
by fxm
Feb 26, 2021 13:32
Forum: General
Topic: wth -- Thread time .vs Subroutine time
Replies: 192
Views: 6338

Re: wth -- Thread time .vs Subroutine time

Warning when using dynamic instances of ThreadInitThenMultiStart or ThreadPooling When using dynamic instances of these types, their addresses should not be changed during their lifetimes, due to the associated internal thread that constantly accesses the data members from a pointer passed once to ...
by fxm
Feb 25, 2021 19:29
Forum: Beginners
Topic: Purpose of Syntax declares in language documentation
Replies: 6
Views: 262

Re: Purpose of Syntax declares in language documentation

In the 'Syntax' paragraph of the documentation pages, one or more declaration syntaxes are listed for information only. As many keywords support alternative syntaxes with parameters of different types, these declaration syntaxes are just synthetic images of the internal compiler declarations. These ...
by fxm
Feb 25, 2021 8:58
Forum: Documentation
Topic: Minor error in Time docs
Replies: 1
Views: 113

Re: Minor error in Time docs

Done:
KeyPgTime → fxm [was missing a word]
by fxm
Feb 25, 2021 8:01
Forum: Community Discussion
Topic: What does this mean?
Replies: 12
Views: 582

Re: What does this mean?

The initializer '= Any' should be reserved for very specific cases where the gain of a few microseconds is necessary. Otherwise, beware of crashes if this is applied to UDTs containing member objects that must absolutely be initialized at least by default (already the var-len strings or dyna...
by fxm
Feb 24, 2021 9:23
Forum: General
Topic: is redim inside threads safe? ( memory leak help :O, ) (SOLVED)
Replies: 14
Views: 450

Re: is redim inside threads safe? ( memory leak help :O, )

is redim inside threads safe? If the critical section of the code accessing the array (Redim, read/write access, access to U/Lbound, ...) in each thread code including the main code (implicit thread) is protected by a locking/unlocking mutex block, this mutex being common to all threads (including ...
by fxm
Feb 24, 2021 6:08
Forum: General
Topic: is redim inside threads safe? ( memory leak help :O, ) (SOLVED)
Replies: 14
Views: 450

Re: is redim inside threads safe? ( memory leak help :O, )

SamL wrote:I'm using threaddetach() on all threads once a thread is done another thread can be created. total running threads is tracked by a shared array.

A little short to fully understand your thread management principle.
(sample code would be welcome)
by fxm
Feb 24, 2021 5:55
Forum: Beginners
Topic: How to modularize code
Replies: 16
Views: 532

Re: How to modularize code

The many variables can be grouped together in structure(s) such as UDT(s). Therefore, only UDT instance(s) is(are) passed as parameter(s).
by fxm
Feb 23, 2021 10:27
Forum: Community Discussion
Topic: Where can I get a Recent-Git-Build of FreeBASIC?
Replies: 509
Views: 92210

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

fxm wrote:@St_W,

A problem with your PC(s) ?

Could we have some news?
by fxm
Feb 23, 2021 8:21
Forum: Beginners
Topic: How to modularize code
Replies: 16
Views: 532

Re: How to modularize code

T I have separate subs and functions and global variables with global structures working as 1 BIG file but would link to know what to do to have them as separate modules in separate files. Already, it is not good to use global variables in a module to pass them implicitly to internal procedures, in...
by fxm
Feb 22, 2021 21:20
Forum: Documentation
Topic: Pointers for UDTs
Replies: 3
Views: 126

Re: Pointers for UDTs

Done:
KeyPgPtr → fxm [this modifier can also be applied to UDTs]
by fxm
Feb 21, 2021 9:53
Forum: Community Discussion
Topic: FreeBASIC 1.07 Release Discussion
Replies: 93
Views: 16753

Re: FreeBASIC 1.07 Release Discussion

I have some errors with 1.07.3 ( but OK with 1.07.1 ) That would surprise me a lot! I think the "Define" is rather intended to be used as this (if there is a function returning it): #define ZSTD_COMPRESSBOUND(srcSize) (((srcSize) + ((srcSize) shr 8)) + iif((srcSize) < (128 shl 10), ((128 ...
by fxm
Feb 20, 2021 9:00
Forum: Community Discussion
Topic: type and static type
Replies: 15
Views: 744

Re: type and static type

is any way here, to get the count of virtual functions, in runtime? To my knowledge no. I think the compiler fills in a new vtable for each new class (type with virtual procedures) on the fly, but probably Jeff or dkl can answer better than me. Everything I know about the vptr / vtable structure is...

Go to advanced search