[PD] usleep() equivalent to Sleep() ?
joge .
gboy at nycap.rr.com
Mon May 13 20:27:25 CEST 2002
here is some info on the Buffer Overrun term :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/
vclrf_set_security_error_handler.asp
[you might have to copy both lines individually and glue them back together
in your browser]
also here is the exact message that i get from the Visual C++ Runtime :
Buffer overrun detected!
Program: D:\downloads\pd\pd-0.35-test23\bin\pd.exe
A buffer overrun has been detected which has corrupted the program's
internal state. The program cannot safely continue execution and must now
be terminated.
.........
examining the code some more , the error seems to happen when the extern [i
am test all of this on sonogram~ frist] tries to draw the sonogram after the
record message is hit .
joge .
>
>
> > hi,
> >
> > Olaf's help is very useful here
> > because "sleep" on UNIX takes
> > a number of seconds as argument
> > ( thus, different from Windows' sleep ).
> >
>
> i took care of the microseconds to milliseconds issue . thanks .
>
> > If you ported the code "as is",
> > there should be a delay of 100 seconds
> > before drawing anything,
> > i guess that's not what you expect.
> >
> > So, divide THREAD_SLEEP_TIME by 1000.
> >
> > Next, i don't really know what you mean by
> > "buffer overrun", maybe because i never
> > used PD on Windows ???
> >
>
> i am not sure what a buffer overrun is either . i am imagining its just
> means that the program is writing to an array past the end of the declared
> array space .
>
> i have narrowed it down to crashing after the the record button is pressed
> that the sample is done playing .
>
> > cheers,
> >
> > yves
> >
> > Olaf Matthes wrote:
> >
> > >Hi,
> > >
> > >usleep() takes time in microseconds, Window's sleep() needs
> milliseconds... this
> > >makes sleep() sleep 1000 times longer than wanted if used with the same
> value...
> > >
> > >Olaf
> > >
> > >"joge ." schrieb:
> > >
> > >>hi all ,
> > >>
> > >>i am trying to compile two externals of yves's on to windows . there
> is
> > >>one issue with threads [i am using pthreads for maximum unix
> compatibility]
> > >>that i seem to be having though . there is no usleep() for windows as
> far
> > >>as i can tell . however i did fine a function called Sleep() . from
my
> > >>brief browsing of code on the internet . i thought the two for the
more
> > >>part were equivalent in their functionality : to put a thread/process
> to
> > >>sleep for a specified amount of time . however , i seem to get
*buffer
> > >>overruns* when i play with the externs . everything compiles fine and
> is
> > >>even loaded fine , it seems to be when the external tries to draw to
the
> > >>screen that i get the buffer overrun . the externals i am trying to
> compile
> > >>over are sonogram~ 0.9 and cooled~ 0.6 .
> > >>
> > >>thanks .
> > >>
> > >>joge .
> > >>
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
More information about the Pd-list
mailing list