[comp.sys.amiga.programmer] Launch and Switch Fields in the Task Structure

barnettj@pookie.crd.ge.com (Janet A Barnett) (03/27/91)

What are the tc_launch and tc_switch fields used for?

I'm writting some numerical software for my amiga and would like to
have separate tasks make use of the 68882.  The SAS/C compiler manual
warns against this, indicating that the operating system does not
properly handle sharing of the coprocessor between tasks.  So, my
question is: can the task launch and switch fields be used to save the
state of the coprocessor when a task loses the CPU and restore it when
the CPU is regained? For fun, I tried poking the address of routines
internal to my code in these fields; visits from the GURU ensued.
Meditation has yielded no fruitful thoughts.

AB

jseymour@medar.com (James Seymour) (03/29/91)

In article <17933@crdgw1.crd.ge.com> barnettj@pookie.crd.ge.com (Janet A Barnett) writes:
>                                        ... The SAS/C compiler manual
>warns against this, indicating that the operating system does not
>properly handle sharing of the coprocessor between tasks.  ...

Huh?  Whoa, I hadn't caught that in my SAS/C docs.  Is this true CBM guys?
If so, what's the problem?  If so, does this apply equally to 2.0?  Or
should I just be careful with stuff I plan to make compatable with 1.3
systems?

-- 
Jim Seymour				| Medar, Inc.
...!uunet!medar!jseymour		| 38700 Grand River Ave.
jseymour@medar.com			| Farmington Hills, MI. 48331
CIS: 72730,1166  GEnie: jseymour	| FAX: (313)477-8897

dewolfe@ug.cs.dal.ca (Anarchy for Peace) (03/30/91)

In article <93@hdwr1.medar.com> jseymour@medar.com (James Seymour) writes:
>In article <17933@crdgw1.crd.ge.com> barnettj@pookie.crd.ge.com (Janet A Barnett) writes:
>>                                        ... The SAS/C compiler manual
>>warns against this, indicating that the operating system does not
>>properly handle sharing of the coprocessor between tasks.  ...
>
>Huh?  Whoa, I hadn't caught that in my SAS/C docs.  Is this true CBM guys?
>If so, what's the problem?  If so, does this apply equally to 2.0?  Or
>should I just be careful with stuff I plan to make compatable with 1.3
>systems?
>
I'm not a commodore guy, but my Lattice (5.04) manual says that some 3rd
party accelerator boards don't correctly tie into the task launch/switch signals
for task switching.  They then go on to say that the Commodore boards do
conform and are fine.

It has nothing to do with the OS.

"It's a hardware problem." says the software person.

>-- 
>Jim Seymour				| Medar, Inc.
>...!uunet!medar!jseymour		| 38700 Grand River Ave.
>jseymour@medar.com			| Farmington Hills, MI. 48331
>CIS: 72730,1166  GEnie: jseymour	| FAX: (313)477-8897

--
Colin DeWolfe
dewolfe@ug.cs.dal.ca

dale@boing.UUCP (Dale Luck) (03/30/91)

In article <17933@crdgw1.crd.ge.com> barnettj@pookie.crd.ge.com (Janet A Barnett) writes:
>What are the tc_launch and tc_switch fields used for?
>
>I'm writting some numerical software for my amiga and would like to
>have separate tasks make use of the 68882.  The SAS/C compiler manual
>warns against this, indicating that the operating system does not
>properly handle sharing of the coprocessor between tasks.

This is absolute BS. Ever since WB1.3, the os has supported math coprocessors
In a multitasking environment. If you plan on using the IEEE math libraries
though, each task must open the Math library itself.

There is no need to do any switch/launch programming


-- 
Dale Luck     GfxBase/Boing, Inc.
{uunet!cbmvax|pyramid}!amiga!boing!dale

dale@boing.UUCP (Dale Luck) (03/31/91)

In article <1991Mar29.194508.3712@cs.dal.ca> dewolfe@ug.cs.dal.ca (Anarchy for Peace) writes:
>>
>I'm not a commodore guy, but my Lattice (5.04) manual says that some 3rd
>party accelerator boards don't correctly tie into the task launch/switch signals
>for task switching.  They then go on to say that the Commodore boards do
>conform and are fine.

Any accelerator card that replaces the 68000 with a 68020/68030/...
and 6888x class coprocessor is supported internally by the AmigaOS.

It is only those math accelerator cards that have to be spoon fed data to
get them to work that requires proper vendor support. Commodore does not make
such a thing right now but all the hooks are there for the vendor to supply
software and have their math board supported in a multitasking environment.

I know that at least the Microbotics multifunction board performed properly.

>Colin DeWolfe
>dewolfe@ug.cs.dal.ca

-- 
Dale Luck     GfxBase/Boing, Inc.
{uunet!cbmvax|pyramid}!amiga!boing!dale

jseymour@medar.com (James Seymour) (04/02/91)

In article <963@boing.UUCP> dale@boing.UUCP (Dale Luck) writes:
>In article <17933@crdgw1.crd.ge.com> barnettj@pookie.crd.ge.com (Janet A Barnett) writes:
>>                                       ...  The SAS/C compiler manual
>>warns against this, indicating that the operating system does not
>>properly handle sharing of the coprocessor between tasks.
>
>This is absolute BS. Ever since WB1.3, the os has supported math coprocessors
>In a multitasking environment. ...
>

Thanks Dale.  See what happens when you speak (type?) before
thinking?  I should have recognized right off that the original
article must have been omitting something.  Today, I got lightly
flamed by an associate here at work for my first response to
Janet's original posting (asking CBM-type guys if Janet's
original posting was true).  *I* especially should have
known better, as I did extensive work implementing 68881 support
for a multi-tasking real-time industrial system a couple of
years ago.  Sigh...

-- 
Jim Seymour				| Medar, Inc.
...!uunet!medar!jseymour		| 38700 Grand River Ave.
jseymour@medar.com			| Farmington Hills, MI. 48331
CIS: 72730,1166  GEnie: jseymour	| FAX: (313)477-8897