How to talk to a specific thread in a server

Björn Döbel doebel at os.inf.tu-dresden.de
Thu May 8 08:07:19 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On 08.05.2014 03:29, Yuxin Ren wrote:
> I have one client and one server talking to each other, and both of
> them have 2 threads. I want thread 1 in client only talk to thread
> 1 in server, and thread 2 in client only talk to thread 2 in
> server. How can I achieve this?

The simple client/server example
(http://wiki.tudos.org/L4Re_simple_client_server_example) shows how to
connect a single thread in each process (or task in L4 speak). You
could extend this example to create two channels in the Lua setup
file, pass both channels to the tasks during startup and then let each
thread use one of them for communication with its counterpart.

Note that does not completely enforce your requirement that each
thread can only talk to exactly one other. Capabilities (e.g., for the
communication channels) are shared per task and technically each
thread could therefore send messages on each channel. If you want
strict isolation, you have to separate the threads into separate tasks.

Bjoern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlNrHxcACgkQP5ijxgQLUNlXnACcDvr4kJClvyp5Tdg01JOLpnxB
1iMAnRAJ7AV4aVJOGSqK7W2SOjqQ7LID
=4Fk7
-----END PGP SIGNATURE-----




More information about the l4-hackers mailing list