Search found 2619 matches

by badidea
May 08, 2025 22:34
Forum: Archive
Topic: quitting smoking app
Replies: 8
Views: 18962

Re: quitting smoking app

I don't believe in those vapes. You just replace one unhealthy nicotine addiction with another, maybe a bit less unhealthy, nicotine addiction. What helped me for was Allen Carr's book, a world wide pandemic and hot tea with rum at the end of the day. I do not miss it now, I replaced it with the mor...
by badidea
Apr 13, 2025 22:30
Forum: Beginners
Topic: Need Guidance: Combining FreeBasic Files into One Executable & GTK Basics (Beginner Struggles!)
Replies: 11
Views: 1803

Re: Need Guidance: Combining FreeBasic Files into One Executable & GTK Basics (Beginner Struggles!)

Hi, I cannot help with GTK. There are a few examples shipped with freebasic, see: https://github.com/freebasic/fbc/tree/master/examples/GUI/GTK%2B I can not say how useful they are. I have to install some libraries first. Concerning compiling, you can do: fbc main.bas utils.bas gui.bas -x myprogram ...
by badidea
Mar 10, 2025 23:38
Forum: Documentation
Topic: How to Manage a Critical Section of the code of a Thread in FB
Replies: 40
Views: 39340

Re: How to Manage a Critical Section of the code of a Thread in FB

@fxm, I tried to follow your thread pooling code, but it looks so complicated, so I made my own. #include "string.bi" const C_GN = 10, C_RD = 12, C_YL = 14, C_WH = 15 const THR_STAT_BUSY = 0 const THR_STAT_IDLE = 1 const THR_STAT_FINISHED = 2 dim as string thrStatusStr(...) = {"Busy&q...
by badidea
Mar 07, 2025 21:59
Forum: Sources, Examples, Tips and Tricks
Topic: peaceful travel among the stars
Replies: 12
Views: 2245

Re: peaceful travel among the stars

Cool, I think it needs a spaceship in the center and an options to fire engage the warp drive.
by badidea
Feb 23, 2025 23:08
Forum: Sources, Examples, Tips and Tricks
Topic: Image resizing
Replies: 19
Views: 4561

Re: Image resizing

With MultiPut @ https://www.freebasic.net/forum/viewtopic.php?t=24479 And code: #if __FB_LANG__ = "qb" #define EXTCHAR Chr$(0) #else #define EXTCHAR Chr(255) #endif #include "fbgfx.bi" Using FB dim shared as any ptr src_img dim shared as single di_size=1.0 'Size of destination im...
by badidea
Feb 15, 2025 19:26
Forum: Documentation
Topic: How to Manage a Critical Section of the code of a Thread in FB
Replies: 40
Views: 39340

Re: How to Manage a Critical Section of the code of a Thread in FB

The performance of Rnd is irrelevant for my application. It would save microseconds on a minutes (of even hours) timescale.

@moderator: This seems to go off-topic.
by badidea
Feb 12, 2025 22:59
Forum: Documentation
Topic: How to Manage a Critical Section of the code of a Thread in FB
Replies: 40
Views: 39340

Re: How to Manage a Critical Section of the code of a Thread in FB

I see it mostly as a warning: freebasic's variable length strings and multithreading don't work well together. An example of a generated crossword for which I am now using multithreading as I ran out out ideas to speed up the code otherwise: https://github.com/verybadidea/crossword_generator/blob/ma...
by badidea
Jan 31, 2025 19:13
Forum: General
Topic: Thread status polling - safe?
Replies: 30
Views: 9600

Re: Thread status polling - safe?

What do you have as entry_type? Now with: type entry_type dim as zstring * 32 word dim as string clue 'dim as string word, clue end type With your custom string copy it is indeed faster. But even faster is leaving out the copy, and just use: dim as u8 wpch = entries.entry(ipw).word[ichpw] In the nex...
by badidea
Jan 27, 2025 22:58
Forum: General
Topic: Thread status polling - safe?
Replies: 30
Views: 9600

Re: Thread status polling - safe?

I haven't done much testing myself yet, but I did notice that switching to fixed length zstring also improves single threaded performance. This is nice but I did not expect that since I use len() at various location which I expected to be slower for zstring. May be this an example where fast CPU cac...
by badidea
Jan 25, 2025 23:14
Forum: General
Topic: Thread status polling - safe?
Replies: 30
Views: 9600

Re: Thread status polling - safe?

That looks good. Some extra locking going on in normal fb strings for thread safety? I tried a few unsuccessfully things. Among others my non-recursive solver which was performing dramatically bad with multiple threads. It is a pity that we have a low level language but still limited control over th...
by badidea
Jan 24, 2025 7:44
Forum: Documentation
Topic: Wiki improvements
Replies: 781
Views: 424411

Re: Wiki improvements

The first (with less information) seems better to me. In both suggestions the reference to heap is gone, but in the second 'static storage or program stack' is now mentioned which is confusing if we don't explain the difference between these 2 concepts. Maybe add a link to https://www.freebasic.net/...
by badidea
Jan 23, 2025 22:05
Forum: Documentation
Topic: Wiki improvements
Replies: 781
Views: 424411

Re: Wiki improvements

@fxm: Is this statement on https://www.freebasic.net/wiki/TutIntroArrays correct? " Static arrays , the arrays described above, are kept on the heap , but dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the reques...
by badidea
Jan 23, 2025 21:52
Forum: General
Topic: Thread status polling - safe?
Replies: 30
Views: 9600

Re: Thread status polling - safe?

I modified the thread 'wordmap_type.recursiveSmart0()' so that it works internally on a copy of the instance passed (copy at the beginning, and copy back at the end) like this (so we lose the monitoring of the progress): ...code... That would not help much, recursiveSmart0() is only called 170 time...