I tried to run buildlinux.sh and it cannot find ../bin/fbc:
norby@norby-xps:~/Projects/TI_System/sfx$ bash ./buildlinux.sh
build cpu layer
./buildlinux.sh: line 3: ../bin/fbc: No such file or directory
norby@norby-xps:~/Projects/TI_System/sfx$
norby@norby-xps:~/Projects/TI_System/sfx$ bash ./buildlinux.sh
build cpu layer
./buildlinux.sh: line 3: ../bin/fbc: No such file or directory
norby@norby-xps:~/Projects/TI_System/sfx$
Code: Select all
if thread_handle=0 then thread_handle = threadcreate( @_FMSoundThread)
Code: Select all
if thread_handle=0 then thread_handle = threadcreate( @_FMSoundThread,0,1000000)
Code: Select all
sub _FMSoundThread(ByVal userdata As Any Ptr )
dim as short Buffer(4096*8)
Code: Select all
dim shared as short Buffer(4096*8)
sub _FMSoundThread(ByVal userdata As Any Ptr )
Why does it happen?On some systems (Linux), the stack automatically grows beyond stack_size if more space is needed; on others (Win32), this is the fixed maximum allowed. Behavior is undefined when more stack is used than the reserved size on systems where stacks are not able to grow.
Someone misread or misunderstood the man page for pthread_attr_setstacksize. That's been on the wiki page since the dawn of time so who knows what the man page said then, but now it says:Why does it happen?
Using 8MB as an example, what 'dynamically grow its stack' seems to mean is 'uses guard pages to allocate it on demand a page at a time' whereas, by default, those created with pthread_create allocate the entire 8MB as read-write up front. It doesn't mean 'has an infinitely-large stack' and as it says, wouldn't apply to threadcreated threads if it did.A thread's stack size is fixed at the time of thread creation.
Only the main thread can dynamically grow its stack.
Code: Select all
#include "sfx.bi"
#inclib "fbsfx"
SoundmidiSet ()
PLAY "a4e4g4a4g4e4c2f4f4f2d4d4d2"
Code: Select all
#include "sfx.bi"
#inclib "fbsfx"
SoundmidiSet ()
Dim As Any Ptr Midi=LoadMidi("music.mid")
PlayMidi(Midi, 1)
Sleep
Awesome, thanks. Everything seems to be working right now. Just one question, is there a limit on midi files? I tried loading a 20KB file and it still core dumped on me. Other, shorter midis, worked great.
Code: Select all
const MaxTracks=16