Welcome, Guest. Please login or register.

Author Topic: CreateNewProcTags() over sasc and vbcc  (Read 5532 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kas1eTopic starter

CreateNewProcTags() over sasc and vbcc
« on: April 11, 2006, 03:59:23 PM »
Here is example:
Code: [Select]

#include <dos/dostags.h>
#include <proto/dos.h>
#include <proto/exec.h>

struct Process *player;

__saveds void play_module(void)
{

Printf(&quot;ooooo\n&quot;);
Printf(&quot;uuuu\n&quot;);
Printf(&quot;ieeetss\n&quot;);
}

int main(void)
{

printf(&quot;first\n&quot;);

player = CreateNewProcTags(
NP_Entry, &play_module,
NP_Priority, 1,
NP_Name, &quot;Player Process&quot;,
TAG_DONE);

printf(&quot;second\n&quot;);
Delay(200);
printf(&quot;third\n&quot;);

}

so, result:
Code: [Select]

work:programming>spawn_vbcc
first
ooooo
uuuu
ieeetss
second
third

work:programming>spawn_sasc
first
second
third
work:programming>

It looks like  over vbcc it works, over sasc - not. If i add (for example) in span thread a fucntion like SystemTagList("newcli",0); over vbcc is works, over sasc - reboot with red flashing of screen.

by default i have nosmalldata and nosmallcode in sasc options. Any idea how it must be looks like ?:)
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #1 on: April 11, 2006, 04:27:20 PM »
was try also this:
Code: [Select]

player = CreateNewProcTags(
NP_Entry, &play_module,
NP_Priority, 1,
NP_Name, &quot;Player Process&quot;,
NP_Input, Input(),
NP_CloseInput, FALSE,
NP_Output, Output(),
NP_CloseOutput, FALSE,
TAG_DONE);


the same. also, why it works over vbcc, and do not works over sasc ?
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #2 on: May 12, 2006, 12:21:30 PM »
@piru
Thanks for good answer, but question is still here:
why CreateNewProcTags do not works over sasc, and the same code works ok on vbcc ? Maybe someone have little example for sasc how it must be used ?

I do not mean with printf, any example will be good. Just spawning a new console, or write somethink to file. In other words, anythink that will show , that proccess is created and works (i mean over sasc of course).
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #3 on: May 12, 2006, 06:48:44 PM »
@piru
maybe it's strange, but i copy your example 1:1, and do compiling as you said 1:1 too. After running - freeze or reboot or red flashing screen.

I tryed it on winuae, but the same code over vbcc works just fine. I also try it on my a1200/060. After running nothink happenes. CPU is loaded on 100%.

maybe will be matter version of sasc which i am using. On compiling stage it sais: SAS/C amiga compiper 6.50
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #4 on: May 12, 2006, 07:10:52 PM »
The same .. will try to upgrade to the 6.58 right now.
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #5 on: May 12, 2006, 07:17:54 PM »
The same .. will try to upgrade to the 6.58 right now.

edit: but 100% of cpu load it is not normal. and it's just must do kprintfs (so be not to console), and exit. But is always in freeze state.

btw, if i will put in newproc SystemTagList("newcli",0); without any printfs/kprintfs it must spawn a shell i think ?
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #6 on: May 13, 2006, 09:39:48 AM »
after patch to 6.55. it works, but very strange. sometimes it runs ok , sometimes not. sometimes it run ok from golded ide, sometimes not. from the shell, or from icon, or from dopus - can't run always (faulth is here).

for you it's just works always ? in the shell, from icon, etc ?

right now, i just recopy your example, go to the shell, and put your compiling string:
Code: [Select]

work:programming>sc resopt link spawn_thread.c lib lib:debug.lib
SAS/C Amiga Compiler 6.58
Copyright (c) 1988-1995 SAS Institute Inc.
Slink - Version 6.58
Copyright (c) 1988-1995 SAS Institute, Inc.  All Rights Reserved.

SLINK Complete - Maximum code size = 1948 ($0000079c) bytes

Final output file size = 2540 ($000009ec) bytes
work:programming>spawn_thread

and faulth is here.
 

Offline kas1eTopic starter

Re: CreateNewProcTags() over sasc and vbcc
« Reply #7 on: May 13, 2006, 11:05:13 AM »
@piru
thanks, with 'nostkchk' works always just fine :) also maybe you can give me a little brief about Forbid() and Permit() calls ? I understand from docs of course, that forbid() - forbid task resheduiling, and while not found Permit(); will dissallow resheduiling, but where it's necessary in real life ? i mean in all of my lame srcs i do not use Forbid/Permit, but all works ok. where it necessary really ?