Welcome, Guest. Please login or register.

Author Topic: CreateNewProc bug in SASC ?  (Read 2794 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
Re: CreateNewProc bug in SASC ?
« Reply #14 from previous page: August 19, 2007, 10:54:54 PM »
It must be what Thomas suggested, I just moved this piece of code from VBCC to SASC to be able to use it's debugger and kept most of the default options.

As for stdio not being thread safe. I've debugged various multithreaded functions in the past and worst result I've had AFAIremember was the text output being mixed up, but no crashes.

Cheers for the replies
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: CreateNewProc bug in SASC ?
« Reply #15 on: August 19, 2007, 11:23:56 PM »
@Jose
Quote
As for stdio not being thread safe. I've debugged various multithreaded functions in the past and worst result I've had AFAIremember was the text output being mixed up, but no crashes.

It can crash, it's just not very likely to happen.

However, in my personal opinion nothing is more annoying than rare, untrackable crashes.
 

Offline Gilloo

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 124
    • Show only replies by Gilloo
Re: CreateNewProc bug in SASC ?
« Reply #16 on: September 19, 2007, 12:55:25 PM »
Hello,
Try with this code, it certainly work better.


/* Function caller */
void CllFnc(void)
{ Forbid();
  FPrintf(Output(),"Test text working!!!\n");
}
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: CreateNewProc bug in SASC ?
« Reply #17 on: September 19, 2007, 01:17:31 PM »
Quote
Try with this code, it certainly work better.

Actually it doesn't. dos.library buffered I/O isn't thread safe (that is, you cannot safely access buffered filehandle from multiple processes). The filehandle buffer isn't protected against simultanous access, so if you're unlucky things can go badly wrong.

If you print just couple of lines it's not very likely to break, however.
 

Offline Einstein

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show only replies by Einstein
Re: CreateNewProc bug in SASC ?
« Reply #18 on: September 19, 2007, 02:03:42 PM »
Quote
void CllFnc(void);


Quote
PrcTgs[0].ti_Tag = NP_Entry;


My Opinion:

Are we influenced by awkward Unix naming convention perhaps ?  :roll:
Nowadays I see other operating systems with clear, fully descriptive, and rationally named APIs, something Amiga should've done long ago, why do certain amiga programmers insist on going the unix convetion way ?

Why not just..

void CallFunction( void );
..
newProcessTags[ 0 ].ti_Tag = NP_Entry;

..?


Just to expand, things like:

window->RPort vs screen->RastPort
struct RastPort vs struct RasInfo (without a "t")
struct RasInfo vs struct Layer_Info (with an underscore)

 :-?

And these are just a few of the annoyances.

Just my opinion, no more rants lol.
I have spoken !
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
Re: CreateNewProc bug in SASC ?
« Reply #19 on: September 27, 2007, 08:20:41 PM »
@Einstein

Never messed with it, but I think names are irrelevant...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Einstein

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show only replies by Einstein
Re: CreateNewProc bug in SASC ?
« Reply #20 on: September 27, 2007, 08:34:08 PM »
I agree, they are irrelevant when used privately, but in case of Open Source, or as formal APIs, unix like naming can be a real pain in the ass, float myCents = 0.000001;.
I have spoken !