Error

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

Error

Post by roy »

Hi All

I'm writing a demo which runs in windows, but when I run it in the SDLIDE editor it runs for a while and then it stops with the error below at the oscli line

Any ideas why

Thanks Roy


Image
guest

Re: Error

Post by guest »

roy wrote: Sat 14 Apr 2018, 19:42 Any ideas why
I expect it's one of those occasions when the error message is unhelpful. What BBC BASIC does is to call the SDL_GetError API function and report whatever string is returned, but that function seems not always to want to be informative! So ignore the error message and concentrate on the line at which it is occurring, you will almost certainly find the fault there. I'm sure you are well aware that when debugging OSCLI statements the trick is replace OSCLI with PRINT.

Richard.
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

Re: Error

Post by roy »

Thanks print tip Richard

I'll see what I can do.

Regards Roy
guest

Re: Error

Post by guest »

admin wrote: Sat 14 Apr 2018, 20:05that function seems not always to want to be informative!
Thinking about it I expect the reason is that SDL_GetError is not thread safe: if an error has since occurred on another thread the function will no doubt return the other thread's error rather than the one that was responsible for your program failing! Annoying, but I don't think there is anything I can do about it.

Richard.
PEPPOS
Posts: 1
Joined: Sat 26 May 2018, 12:31

Re: Error

Post by PEPPOS »

excuse me but is the first time that I write you. I should know how use the thread core for my Intel 4 core.. My listing is a sorting code, but the time for running the reply is too long. The file to sorting is about 10,000.000 of seriations of 5 numbers , in totale are 30million of numbers, : 234 543 222 991 435 (random) . I should like divide the file in 4 for operating with 4 core. How is the system for proceeding ? Excuse non perfect english.
giuseppe.villamaina@libero.it (an old statistic hobbyst 79 years old)
DDRM

Re: Error

Post by DDRM »

Hi Peppos,

There was some discussion of setting up multiple threads which could run on different cores: if you want to pursue that I suggest you have a look though the backups of the two old forums. I should warn you it's not too pretty, and involves assembler code. The speedup is likely to be less than you are hoping for.

Have you looked at using the SORTLIB library? That is an efficient sorting algorithm, coded in assembler. It is pretty unlikely you'll do significantly better than that. SInce BBC BASIC is an interpreted language, anything written in BBC BASIC itself (unless you use the embedded assembler) is likely to be MUCH slower.

Best wishes,

D