473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

inter process communication versus threads

Hi all,

I recently finished a small project using perl and tk/tcl which caused
me several headaches. I have now decided to have a go at VB .net and
thought a good place to start would be recreating the perl
application.
However, once again i'm running into similar headaches and wondered if
i could get a real developers opinion on how he/she would implement
it.
Basically the application is a small GUI wherein the user can enter an
IP address/port number.
There are two slider (track bars) controls which represent packet rate
per second and packet size in bytes.
When the start button is clicked a udp socket is created and the
application then starts to write packets to the socket according to
the values in the sliders. The user can change the slider values such
that they can change the udp packet rate and/or packet size in real
time.
In the perl implementation i did this via threads where a separate
thread ran the udp socket.
The sliders in the main thread would update global variables which
were declared as shared. This allowed the udp thread to access them so
when a change occured in the slider values, the thread would take the
new values on board and adjust the action of writing to the udp socket
accordingly.

However, it seems that to do this in vb .net the advice i keep reading
is that windows form controls are not thread safe, and i can't really
get a good notion of how to do this. As understand it you can give a
thread an initial value and read a result once its finished but here i
need to be able to send it values as soon as the user changes it.

When writing in perl i also looked into creating separate processes
and communicating between them via sockets etc as i was having similar
problems with threads and tk/tcl. However i managed to get around them
and it seems to work quite well.

Anyway, i'm not a developer and so i would love to hear from anyone
who is how they would go about doing this i.e. threads, separate
processes or something else i'm not aware of.

I'd really appreciate it.

Thanks!

May 10 '07 #1
2 1623

Hi Master,

You are right, they are not thread safe. This is why Microsoft gave the
Control object an "Invoke" method. Invoke will ensure the method on the
control is called on the controls thread, not on the callers thread. To
learn more, google for Control.Invoke+VB.NET or look in MSDN. Also look
for BeginInvoke, EndInvoke for asynchronous invocation.


Robin
May 10 '07 #2
On 10 May, 17:14, "Robin Tucker" <rtgro...@hotmail.co.ukwrote:
Hi Master,

You are right, they are not thread safe. This is why Microsoft gave the
Control object an "Invoke" method. Invoke will ensure the method on the
control is called on the controls thread, not on the callers thread. To
learn more, google for Control.Invoke+VB.NET or look in MSDN. Also look
for BeginInvoke, EndInvoke for asynchronous invocation.

Robin
Thanks Robin, i'll take you up on your advice.

Thanks for replying.

May 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Frank Meng | last post by:
Hi. I am trying a csharp sample from http://www.codeproject.com/csharp/socketsincs.asp . (Sorry I didn't post all the source codes here, please get the codes from above link if you want to try)....
4
by: Viper Venom | last post by:
Dear All: I am trying to write an application that consist 2 executables 1) Server.exe 2) Client.exe I start the server.exe first and then start the two client exe by code and kill both of...
7
by: A.M | last post by:
Hi, What is the best way to implemet Inter Process Communication in .NET ? I developed two programs and I want to have them talk to each other. Thanks, Alan
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
0
by: Hugo Ferreira | last post by:
Hi everyone! Here's the current scenario: I have a program in Python that computes something very fast (<1s), but it takes a considerable amount of time to read the startup data (>90s). Since...
2
by: hiharsh | last post by:
Hi Friends, I am trying to implement C programs say Transmit.c and Receive.c Transmit Program would periodicall send message while Receive program will listen to those messge. I will add...
6
by: ecir.hana | last post by:
Hi, let's say I have two scripts: one does some computations and the other one is a graphical front end for launching the first one. And both run in separate processes (front end runs and that it...
6
by: Kasper Lindberg | last post by:
Hi NG, How to do two-way-interprocess communication using java? Imagine a client/server setup where the client can request a number of functions to be performed by the server. Since the...
0
by: dantz | last post by:
After reading all of the materials in msdn about interprocess communication now I am confused. I hope someone can give me some enlightment. I am developing a multithreaded client-server...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.