Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
socket programming in matlab

Subject: socket programming in matlab

From: rohith b

Date: 13 Aug, 2010 16:46:04

Message: 1 of 3

does matlab support multithreading ???
   
I need to have a server serving many clients. Does anyone know how to go about it in matlab (code) ???
Any ideas will be very helpful...UDP and TCP socket programming...

Thanks in advance...

Regards,
rohith

Subject: socket programming in matlab

From: Walter Roberson

Date: 13 Aug, 2010 19:20:21

Message: 2 of 3

rohith b wrote:
> does matlab support multithreading ???

Only if you have the distributed computing add-on packages.

> I need to have a server serving many clients. Does anyone know how to
> go about it in matlab (code) ???
> Any ideas will be very helpful...UDP and TCP socket programming...

Matlab cannot act as a server for TCP (or at least the routines provided by
Mathworks cannot; you might _perhaps_ be able to get it to work if you use the
tcpudp toolbox Matlab File Exchange (FEX) contribution... but no promises as I
have not seen any reports of anyone having tried that.)

Note that when I say that matlab only supports multithreading if you have the
distributed computing add-ons, I am talking about the levels available to
Matlab itself. Matlab normally runs as a single Java thread; you can use Java
thread creation methods to create additional Java threads, but they will not
have access to the Matlab workspaces except by communicating with the single
main Matlab thread.

Subject: socket programming in matlab

From: Yair Altman

Date: 27 Aug, 2010 13:00:32

Message: 3 of 3

Walter Roberson <roberson@hushmail.com> wrote in message <i445ui$lfr$1@canopus.cc.umanitoba.ca>...
> rohith b wrote:
> > does matlab support multithreading ???
>
> Only if you have the distributed computing add-on packages.
>
> > I need to have a server serving many clients. Does anyone know how to
> > go about it in matlab (code) ???
> > Any ideas will be very helpful...UDP and TCP socket programming...
>
> Matlab cannot act as a server for TCP (or at least the routines provided by
> Mathworks cannot; you might _perhaps_ be able to get it to work if you use the
> tcpudp toolbox Matlab File Exchange (FEX) contribution... but no promises as I
> have not seen any reports of anyone having tried that.)
>
> Note that when I say that matlab only supports multithreading if you have the
> distributed computing add-ons, I am talking about the levels available to
> Matlab itself. Matlab normally runs as a single Java thread; you can use Java
> thread creation methods to create additional Java threads, but they will not
> have access to the Matlab workspaces except by communicating with the single
> main Matlab thread.


You might be interested in Andrzej Karbowski's jPar utility on the Matlab File Exchange ( http://www.mathworks.com/matlabcentral/fileexchange/24924-jpar-parallelizing-matlab ) - jPar is a Matlab computation-parallelization engine that connects remote Matlab sessions using Java RMI, without requiring any external toolbox.

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us