Search found 25 matches

by SamL
Aug 20, 2020 9:10
Forum: General
Topic: Trigonometry-Patterns
Replies: 42
Views: 922

Re: Trigonometry-Patterns

and one more of yours with color. 'press ESC key to end Function rnd_range (first As Double, last As Double) As Double Function = Rnd * (last - first) + first End Function function next_point(value as integer, byref weight as byte ) as integer 'color settings dim as integer effect_1 = 2'00 'between ...
by SamL
Aug 20, 2020 7:48
Forum: General
Topic: Trigonometry-Patterns
Replies: 42
Views: 922

Re: Trigonometry-Patterns

NICE! I have some stuff i made. I would not call it trig though. here i added color to one of yours :D 'press ESC key to end Function rnd_range (first As Double, last As Double) As Double Function = Rnd * (last - first) + first End Function function next_point(value as integer, byref weight as byte ...
by SamL
Aug 20, 2020 6:59
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

Re: [Test Conclusion] Does ThreadDetach cause memory leak?

last test using ThreadDetach start time 2:27 AM 8/20/2020 end time = 6:46 AM 8/20/2020 total test time = 5 hours, 13 min start of test minimum memory used 1.4 MB maximum memory used 2.6 MB End of test minimum memory used 1.6 MB maximum memory used 2.8 MB same thing with memory increasing over time a...
by SamL
Aug 20, 2020 1:43
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

Re: [Test Conclusion] Does ThreadDetach cause memory leak?

new simpler test. test result. start time 20:24 PM 8/19/2020 end time = 1:24 AM 8/20/2020 total test time = 5 hours, 48 min start of test minimum memory used 1.4 MB maximum memory used 2.6 MB End of test minimum memory used 1.6 MB maximum memory used 2.8 MB After 4 hours the memory use stabilized at...
by SamL
Aug 19, 2020 7:43
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

Re: [Test Conclusion] Does ThreadDetach cause memory leak?

yes your right i i overlooked the sleep x,1 in this test! I will test that tomorrow. and post results.
by SamL
Aug 19, 2020 4:14
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

[Test Conclusion] Does ThreadDetach cause memory leak?

Testing in environment:
windows 10 workstation
FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit)
AMD Ryzen 7 2700X
32 GB ram

( If i have over looked any thing please correct me. thank you!! )

Test conclusion,
( I removed the wrong conclusion due to bad code design )
SamL
by SamL
Aug 19, 2020 3:47
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

Re: Does ThreadDetach cause memory leak?

test 6 #include "fbthread.bi" declare sub test_sub( param as any ptr ) type UDT as long number1 as long number2 as string*1000 st as any ptr thread_handle end type dim shared as byte start_threads = 0 dim t(1 to 100) as udt dim count as ulong do for i as long = 1 to 100 t(i).number1 = i : ...
by SamL
Aug 19, 2020 0:11
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

Re: Does ThreadDetach cause memory leak?

adding test 4 and 5 that uses ThreadWait instead of ThreadDetach #include "fbthread.bi" type UDT as long number1 declare STATIC sub test_sub( param as any ptr ) as long number2 as string*1000 st as any ptr thread_handle end type dim shared as byte start_threads = 0 dim t(1 to 100) as udt d...
by SamL
Aug 18, 2020 22:57
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

Re: Does ThreadDetach cause memory leak?

so far 'test 3' seems to use the least amount of memory, but the memory usage jumps around on all 3 tests.

I'm going to let the tests run for a few hours.

SamL
by SamL
Aug 18, 2020 22:39
Forum: General
Topic: [Test Conclusion] Does ThreadDetach cause memory leak?
Replies: 10
Views: 435

[Test Conclusion] Does ThreadDetach cause memory leak?

( Test Conclusion below ) Does anyone know if ThreadDetach causes a memory leak? I'm running tests now, but just wondering if anyone has done this testing before. the tests are testing more then threaddetach. but I'm searching for a memory leak. Thanks, SamL tests I'm running.. test 1 #include "...
by SamL
Jul 17, 2020 17:32
Forum: Beginners
Topic: is OPEN, Get and Put # (File I/O) thread safe?
Replies: 8
Views: 496

Re: is OPEN, Get and Put # (File I/O) thread safe?

I edited the test code so it generates random strings for each thread so it should make the test better. 'press ESC key to stop test dim shared as string file_name file_name = "D:\test\" Function rnd_range (first As Double, last As Double) As Double Function = Rnd * (last - first) + first ...
by SamL
Jul 17, 2020 16:48
Forum: Beginners
Topic: is OPEN, Get and Put # (File I/O) thread safe?
Replies: 8
Views: 496

Re: is OPEN, Get and Put # (File I/O) thread safe?

ya i did not use sleep x,1 in this test. I learned this recently that I needed to set all sleeps in threads to sleep x,1 when I started using fbgfx and screenevent while multi threading! Thanks for the link that clarifies what I was reading in the forums concerning the needed sleep in threads. I'm s...
by SamL
Jul 17, 2020 16:27
Forum: Beginners
Topic: is OPEN, Get and Put # (File I/O) thread safe?
Replies: 8
Views: 496

Re: is OPEN, Get and Put # (File I/O) thread safe?

I learned that using freefile() only works in one thread at a time unless put a mutexlock around freefile() and OPEN. freefile() checks how many files are open before returning a value. so there is a window of time that freefile() could return the same number if making multiple requests for a file n...
by SamL
Jul 17, 2020 16:08
Forum: Beginners
Topic: is OPEN, Get and Put # (File I/O) thread safe?
Replies: 8
Views: 496

Re: is OPEN, Get and Put # (File I/O) thread safe?

I only mutexlock for the file number , and Im not using freefile() Here is the code I used to test. ( I updated the code as I found a few mistakes.. ) NOTE: there is updated code for this test below that uses random strings for testing that will detect issues faster/better than this test. 'press ESC...
by SamL
Jul 17, 2020 15:29
Forum: Beginners
Topic: is OPEN, Get and Put # (File I/O) thread safe?
Replies: 8
Views: 496

Re: is OPEN, Get and Put # (File I/O) thread safe?

ok, thanks for the help! My testing of multi-thread with OPEN, GET and PUT resulted in no issues with multi-threading. The very very rare crash I was hunting down turned out to be Windows 10 resetting the computer for updates and this caused some files to have unexpected data written to them. Appare...

Go to advanced search