Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[VxW] spawning tasks from shell

461 views
Skip to first unread message

satish moorthy

unread,
Jun 4, 2003, 8:18:10 AM6/4/03
to vxwe...@csg.lbl.gov
Dear All

i am not able to understand the differance between spawning a task from shell ie sp mypgm and simply giving mypgm.

Things that can under notice are......
1) -> mypgm
value = 73393464 = 0x45fe538
2) -> sp signalTest
task spawned: id = 460c8a8, name = s1u0
value = 73451688 = 0x460c8a8

Results r same but the values r different.Why ?..??

Thanks and regards


Catch all the cricket action. Download Yahoo! Score tracker

Beny Lederman

unread,
Jun 6, 2003, 3:30:20 PM6/6/03
to VxWorks Users Group List
I am not sure if that's what you are asking, but if you call directly mypgm
from the shell, your code will run under the context of the tShell task,
using the properties assigned to the tShell task such as Priority, Stack
etc... When you spawn a task (using sp), a new task is created to run your
code, and tShell returns after spawning the new task.

For instance, lets say mypgm is a loop. If you call it directly from the
shell you will not be able to use the prompt until the loop is finished,
because tShell is busy in your loop. On the other hand, if you spawn a new
task and tell it to run mypgm, the new task will be busy in your loop, not
tShell.

Best regards,

Beny


Dear All

Thanks and regards

_______________________________________________
VxWorks Users Group mailing list
VxWe...@lbl.gov
http://www-csg.lbl.gov/vxworks/

amine

unread,
Jun 10, 2003, 3:06:46 AM6/10/03
to
satish moorthy <satish_mo...@yahoo.co.in> wrote in
news:mailman.346.105492...@csg.lbl.gov:

> Dear All
>
> i am not able to understand the differance between spawning a task
> from shell ie sp mypgm and simply giving mypgm.
>
> Things that can under notice are......
> 1) -> mypgm
> value = 73393464 = 0x45fe538
> 2) -> sp signalTest
> task spawned: id = 460c8a8, name = s1u0
> value = 73451688 = 0x460c8a8
>
> Results r same but the values r different.Why ?..??
>
> Thanks and regards

directly mypgm, result value is mypgm()'s return value
if no value returned, shell value just a random number, not task ID

Joseph Hadzima

unread,
Jun 11, 2003, 5:44:36 PM6/11/03
to VxWorks Users Group List
Hello

__Think__ of it as executing two different functions.
there is more going on here but I'm not up to writting many
pages today, so I'll save more details for later.

-> myprgm

executes your function "myprgm", causing the shell to block
until it completes, and the value displayed is whatever is
returned by your function (if it is void myprgm(), then
whatever junk is left on the stack).

-> sp myprogm

executes the shell command to spawn a task. this command
creates unique task with myprgm as teh entry point. sp
completes, and returns the task Id which gets displayed,
and myprgm runs as an independent task (if it loops forever
you can see it by executing -> i ), and will have the name
sUtN - where U will be replaced by the shell number, and N
will increment for each task created this way.

HTH

ha...@MccEngineering.Com

> _______________________________________________
> VxWorks Users Group mailing list
> VxWe...@lbl.gov
> http://www-csg.lbl.gov/vxworks/


=====
HADZ.

Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic.

(this Email sent using 100% recycled electrons)

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

0 new messages