🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #13460

Got a resident-problem...

#13460
From: d5kwedb Kristian Wedberg
Date: Thu, 01 Feb 1990 08:51
44 lines
2380 bytes
I can't get my first multitaskingly re-entrant program to work, so I thought
I'd try it out on you guys...

The problem:

	The program "hack" seems to multitask (with itself) ok, seems to be
	serially re-entrant, but if multiple invocations are running the
	same resident code, I can only exit one invocation. When exiting
	another invocation I crash with different guru#'s.

The setup:
	
	"hack" opens GfxBase & IntuitionBase using local variables
	some ports are opened, onbreak() is called, sprintf() used
	CreateTask(child)
	"hack" gives timing-information to 'child' with messages
	close libraries & ports, call onbreak(NULL) & exit()

	child open ports, uses sprintf()
	fools around with WB using GetRGB4()/SetRGB4()
	closes ports
	DeleteTask(NULL)

I'm using Lattice C 5.04, with lc-flag '-v' and linking with lc.lib, and
the child-function uses __saveds.
__saveds makes cres.o unusable, since you get an absolute reference to
_LinkerDB. Any way to get around this? So I remove all globals (except the
librarybases), but ARP's ARes still complains of 'Checksum error', why is that?
With ARes NOCHECK, or Commodores Resident it runs ok (serially, mind you!).

Biggish problem:
	
	Even with ARes NOCHECK I get 'Checksum error' if I try 2 simultaneous
	invocations of the same resident code. What checks does AShell do
	when NOCHECK is set? How do you remove the 'Checksum error' that
	(I assume) pertains to the librarybases?

	With Commodore Resident/Shell I can have multiple invocations running,
	but as mentioned I crash when exiting the SECOND time.

All comments & tricks will be duly received, tried, appreciated, gurued, 
reported, whatever seems apropriate.

    Kristian Wedberg				d5kwedb@dtek.chalmers.se
Technical Details
Message-ID: <679@vice2utc.chalmers.se>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mephisto!tut.cis.ohio-state.edu!snorkelwacker!usc!wuarchive!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!sunic!chalmers!afs-news!hacke9!d5kwedb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mephisto!tut.cis.ohio-state.edu!snorkelwacker!usc!wuarchive!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!sunic!chalmers!afs-news!hacke9!d5kwedb
From: d5kwedb@dtek.chalmers.se. (Kristian Wedberg)
Newsgroups: comp.sys.amiga.tech
Subject: Got a resident-problem...
Keywords: resident tasks lattice ARP
Message-ID: <679@vice2utc.chalmers.se>
Date: 1 Feb 90 08:51:01 GMT
Sender: news@vice2.utc.chalmers.se
Reply-To: d5kwedb@dtek.chalmers.se (Kristian Wedberg)
Organization: Chalmers University of Technology, Gothenburg, Sweden.
Lines: 44