can server side get the thread id of client side?

View: New views
3 Messages — Rating Filter:   Alert me  

can server side get the thread id of client side?

by fangzhengshu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,
I want to write a simple example in l4, and there are to task module: client,server
in the client side, I use the interface which is inplemented in server side.like:
int open(int fd, int flags)
I know that the client side can get the server's thread_id throw name service. I want to ask can the server side get the client's task_id or thread_id?
or must the client side send the thread_id to server?
 
thank you.

--
fang,

_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

Re: can server side get the thread id of client side?

by Björn Döbel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Hi,

> I know that the client side can get the server's thread_id throw name
> service. I want to ask can the server side get the client's task_id or
> thread_id?
> or must the client side send the thread_id to server?

your server will call either l4_ipc_wait() or l4_ipc_reply_and_wait() in
order to receive the message from the client. In both cases there is a
src parameter which will contain the client's thread ID after the system
call returns.

Bjoern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqXieEACgkQP5ijxgQLUNn9YwCfRk1iYaXWGVqpsBUJ91QwI4St
orkAnRuYYSC8NRjohx4bJ2tpEd+iDowg
=Tslf
-----END PGP SIGNATURE-----

_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

Parent Message unknown Re: can server side get the thread id of client side?

by fangzhengshu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,

  3. Re: can server side get the thread id of client side?
     (Bj?rn D?bel)
Message: 3
Date: Fri, 28 Aug 2009 09:40:17 +0200
From: Bj?rn D?bel <doebel@...>
To: L4 Hackers <l4-hackers@...>
Subject: Re: can server side get the thread id of client side?
Message-ID: <4A9789E1.7080503@...>
Content-Type: text/plain; charset=ISO-8859-1

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

Hi,

> I know that the client side can get the server's thread_id throw name
> service. I want to ask can the server side get the client's task_id or
> thread_id?
> or must the client side send the thread_id to server?

your server will call either l4_ipc_wait() or l4_ipc_reply_and_wait() in
order to receive the message from the client. In both cases there is a
src parameter which will contain the client's thread ID after the system
call returns.
sorry for not explaining it clearly.
if I defined two functions in idl file, just like:
interface test{
int open(int fd, int flags);
int close(fd);
};

and I implement them in the server side.
I know that when I use open()/close() in the client side, the server will call the function open_component()/close_component() which are in the server side.

In the open_component()/close_component() function I want to get thread id of the caller to do some operation flag.but as we know, when we call open()/close() in client side, the open_component()/close_component() function in server side will be executed. so we can not use l4_ipc_wait() or l4_ipc_reply_and_wait() function in the open_component()/close_component() function, or it will be stop and wait for a message in the function. So in order to get the thread id in the open_component()/close_component(), when or where should I use the l4_ipc_wait() or l4_ipc_reply and wait()  to get the thread id?

thank you!





--
fang,

_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers