473,698 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1636

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...@hotma il.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
3847
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). I had some troubles when I started 6 threads (each thread made a separate connection) and sent messages to same server simultaneously. Sometimes, not always, the socket looks like ok, but really it is dead. I don't why it happens.
4
4960
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 the client when the server exit (This is already done)
7
31699
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
4134
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 sense to punch out from managed code to native code (I was using IJW) in order to do some amount of floating point work and, if so, what that certain amount of floating point work was approximately. To attempt to do this I made a program that...
0
1875
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 the startup data is pretty static, I want this program to be resident and ready in memory all the time. The client-side of this program is a function in PostgreSQL. For the sake of simplicity, let's assume it is another program in Python that
2
2953
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 more complexities , once i achieve this step How do i achieve this ?
6
3701
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 spawns a subprocess with the computation). Now, if the computation has a result I would like to display it in the front end. In another words, I would like to pass some data from one process to another. How to do that? I'm affraid I can't use a...
6
6582
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 server sometimes pushes messages to the client(s), and no assumption can be made regarding the client and when/how often it is running, a second program (call it CPM) is running on the client machine.
0
2318
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 application which communicates via HTTP Request using HTTPListener/HTTPWebRequest. The server(which is the focus of my question) will be having different modules. I want these modules to communicate with each other using the fastest IPC but I can't figure...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.