|
-
Aug 14th, 2004, 12:57 AM
#1
Thread Starter
Frenzied Member
Whats the best way to send varables between processes rapidly?
Whats the best way to send and receive data between two processes? I have about 10 processes open, all needing to work with data from the (1) main process. My current method is that the main process has all the data in a listbox, and each of the 10 processes grab the first item from that listbox, then delete the first item, so that 10 processes can work at their own pace with data that is stored in the main process.
but naturally , this can create problems. ive found if many apps access that listbox at the same time, and delete items at the same time, the app can crash.
which leads me to this post. what would be the best way of sending/receiving data between applciations?
i thought of another way.. to have an array of 10 textboxes, with the main process assigning the text to those textboxes. the other processes could use WM_GETTEXT to retrieve the string stored in that textbox, and process the data. when finished it could use WM_SETTEXT to set the textbox string to "done", then in the textbox_change event, ill be able to tell which process has completed its task on that string, and the app can assign a new string to the box which the process can retrieve again.
is there a better method to do this?
-
Aug 14th, 2004, 01:09 PM
#2
The picture isn't missing
Some programs use Winsock with the loopback ip(localhost, which basically is 127.0.0.1).
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 14th, 2004, 01:45 PM
#3
Frenzied Member
Winsock is a very good solution, which I'll strongly recommend, it's an easy, safe and fast way to communicate...
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Aug 14th, 2004, 02:02 PM
#4
yay gay
omg? Winsock? Why don't you just send info through SendMessage? It's obviously the BEST way
\m/  \m/
-
Aug 14th, 2004, 02:33 PM
#5
Frenzied Member
Originally posted by PT Exorcist
omg? Winsock? Why don't you just send info through SendMessage? It's obviously the BEST way
Because WinSock does allow dynamic interfacing by all applications using the windows sockets, without needed usage for cryptic api code...
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Aug 14th, 2004, 03:35 PM
#6
The picture isn't missing
Well if you are willing to subclass, you can use SendMessage with a UDT.
But with winsock, you would just need to know the port to connect to, wheras you would need to use specific FindWindow calls to get the main window.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 16th, 2004, 04:52 AM
#7
My multithreading code can handle this.
Click on the link in my sig. And then run the 1st simple demo. This shows how data can be passed between 2 EXEs synchronously and asynchronously.
I feel winsock is overkill here and would be messy to implement.
Woof
-
Aug 19th, 2004, 03:21 PM
#8
Thread Starter
Frenzied Member
i didnt try your code widget as you replied after i had already implemented the winsock..
but wow - is it ever easy to do it with winsock.
lets say you want to process data in a listbox, say 10,000 items. a single thread cant do this quickly. so if you open like 100 'clones' of you program (no gui, only code for processing is here) you can simulate 'multithreading' very very well.. just specify variables like.. say 'timeout', and specify them to
your 'threads' by using
for x = 1 to threadcount
Shell appaddon.exe -timeout 100 -id x.
next
the id will be unique for each thread, and the programs can use the id to decide what port to connect on .
threads that are done processing data can send a message to the main form, which would deliver it another string from the listbox to work with.
wonderful idea with the winsock
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|