🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.amiga.tech
1 messages
1 total messages Started by Colin Fox Sat, 29 Dec 1990 05:41
CreateNewProc()
#7717
Author: Colin Fox
Date: Sat, 29 Dec 1990 05:41
72 lines
3381 bytes

>(kent@swrinde.nde.swri.edu) writes:
>
>Please excuse my ignorance here:

No apology necessary. :)

>If I were to start a thread from a function in my code segment using
>CreateNewProc(), can I access variables global to the parent process?
>Or would this thread be a full-blown process for which I would need to
>set up a shared mem arrangement?


The  Amiga  doesn't  distinguish  between  'threads'  and 'processes'.
Everything  is either a task or a process, and DOS is the only part of
the  system  that  cares  about  the distinction.  A process is just a
super-class  of  a  task.  So each running process/task is fully blown
and independant.


>The  reason  for  this  thread  is to handle gadget input events for a
>window created by the parent since the parent is too busy to deal with
>them  in  a  timely  manner.   I  see I can pass the window ptr in the
>CreateNewProc() call.  Is this kosher?


Hmmm  -  I  think  you're  doing this the hard way.  Why not allow the
thread  to  open  the window and manage it?  It sounds like you want a
client-server  model  here,  which  works quite well.  Trying to share
global  data  between  to  independantly  running  processes  can be a
nightmare.  Whole books are devoted to the topic.  So keep it simple.


>Also, I assume I need to set up a message port in the parent process to
>send a 'kill' message.  Since this thread will be used to handle all
>window input events for this window (created by the parent), the window
>message port should be adequate for receiving the 'kill' message, no?
>
>I.e., am I on the right track?


If  all  you  want is a single message (like KILL), then why not use a
signal?  It's simpler and incurs less overhead.

The  'window'  port  you  are talking about is for IDCMP messages, and
Intuition does things with the port and messages connected there (like
when  the  window  closes).   I wouldn't suggest you posting a private
message  at an IDCMP port.  You may inadvertently collide types with a
new one brought out by commodore.

Also, if you aren't planning on returning the message, there's no need
to  open  a  port.   You  can  send  a one-way message, as long as the
recipient knows how large it is he can delete it.


>
>Thanks much
>Kent Polk: Southwest Research Institute (512) 522-2882
>Internet : kent@swrinde.nde.swri.edu
>UUCP     : $ {cs.utexas.edu, gatech!petro, sun!texsun}!swrinde!kent
>(kent@swrinde.nde.swri.edu)

You're welcome much. Hope it helps. :)

######################################################################
#           |                             | Any opinions expressed   #
# Colin Fox | "...graphics is my life..." | herin reflect only those #
#           +-----------------------------++ of my employer. Me. :)  #
#-----------+   Colin_Fox@MindLink.uucp    +-------------------------#
############|     Home of req.library      |##########################
######################################################################
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads