Welcome, Guest. Please login or register.

Author Topic: Stupid question about if it's possible to link and create two separate executables  (Read 7031 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Is it possible to have two different programs recognize each others variables with linking but still be compiled to two different executables?
I know it sounds stupid but the reason is that I want a created process to be created after the main task and I want it to recognize some global variables between the two.
Now if you know another way of creating a process in
[Edit] I handled this without problems with V36 of course...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Hi. 8-)  Well no, I donĀ“t absolutely need pre v36 compatibility but it would be cool to have it, it could mean when my app is done it will run on more machnines. I won't sacrifice it because of that though...
Message ports, yeah, I know. I'm currently using signals in some parts wich are faster :-) But yes, when the need is passing variables I guess sending a message would be the only way. Still it would be nice to have a process created without needing to have to load it from disk. I also found some stuff about separate compilation of two executables but with linking in some Linux discussion groups (no I'm not into Linux at all I just found that...) and though that could be another solution. But maybe that's not possible with AmigaOS. If I remember correctly with AmigaOS some locations are resolved at load time.


Anyway, what I want the created process to know about is the mainprocess's (the one that created it) task structure so that it can send it a signal. I guess I can do a FindTask(NULL) on the main process and send the result as a message to the second one, wich I'd have to locate first with FindTask (name)... I was just hoping that there would be another way...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Thx all for your time, I decided I'll just go for the messages and ports solution... Semaphores won't be needed because the data won't be dynamic.
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
@bloodline

"One point though, can you allocate the struct in memory that has an MEMF_PUBLIC flag? (I'm having visions of some pointer magic here )....
 "... but if you use a struct then the memory would be allocated from the Program's heap and would be protected against another task."

Code: [Select]
struct OurStructure *OurMessage

OurMessage = (struct OurStructure*)AllocMem (sizeof(OurStructure), MEMF_PUBLIC|MEMF_CLEAR))
/* Initialize the structure after*/
\\"We made Amiga, they {bleep}ed it up\\"