From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 2 Feb 2016 16:17:26 -0200 Message-ID: From: Tiago Natel To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a114432ae7bd651052acd834f Subject: Re: [9fans] Fwd: lib9p: Add clunk callback to Srv struct Topicbox-Message-UUID: 81e0192a-ead9-11e9-9d60-3106f5b1d025 --001a114432ae7bd651052acd834f Content-Type: text/plain; charset=UTF-8 2016-02-01 20:03 GMT-02:00 : > > Is there a reason why lib9p doesn't have a clunk function pointer in Srv > struct? > > what about Srv.destroyfid()? > > Destroyfid > When a Fid's reference count drops to zero (i.e., it > has been clunked and there are no outstanding requests > referring to it), destroyfid is called to allow the > program to dispose of the fid->aux pointer. > > Thanks for your help! I'd tried using destroyfid to achieve what I need but failed. I tried today again implement with destroyfid but realized that it will not fully support what I need. I'm using a file server for exchange data between 9P clients. When a new file is created, I create a plan9 channel and two threads (one for handle reads and other for writes), a write(2) to the file is translated into a sendp and a read(2) is translated into a recvp on the channel. The channel could be buffered or not, and then I want to maintain data allocated (aux related data) anyway, because the file server is a queueing system when channel have a buffer bigger than zero. Apart from that, I want to know how many clients have each file opened to update my stats file. It's possible in any way without a clunk callback? I'm trying to replace a rabbitmq server with this system, but I have a requirement for some way of monitoring of queues size, performance of channels, number of clients connected to each channel (file on dchan), etc, I need this kind of information for make a comparison with the current queue system... Thanks! -- > cinap > > --001a114432ae7bd651052acd834f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2016-02-01 20:03 GMT-02:00 <cinap_lenrek@felloff.net>:
> Is there a r= eason why lib9p doesn't have a clunk function pointer in Srv struct?
what about Srv.destroyfid()?

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Destroyfid
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0When a Fid's ref= erence count drops to zero (i.e., it
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0has been clunked and= there are no outstanding requests
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0referring to it), de= stroyfid is called to allow the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0program to dispose o= f the fid->aux pointer.


Thanks for your help! I'd tried us= ing destroyfid to achieve what I need but failed. I tried today again imple= ment with destroyfid but realized that it will not fully support what I nee= d.

I'm using a file server for exchange data b= etween 9P clients. When a new file is created, I create a plan9 channel and= two threads (one for handle reads and other for writes), a write(2) to the= file is translated into a sendp and a read(2) is translated into a recvp o= n the channel. The channel could be buffered or not, and then I want to mai= ntain data allocated (aux related data) anyway, because the file server is = a queueing system when channel have a buffer bigger than zero.
Apart from that, I want to know how many clients have each fil= e opened to update my stats file. It's possible in any way without a cl= unk callback?

I'm trying to replace a rabbitmq= server with this system, but I have a requirement for some way of monitori= ng of queues size, performance of channels, number of clients connected to = each channel (file on dchan), etc, I need this kind of information for make= a comparison with the current queue system... =C2=A0

<= div>Thanks!

--
cinap


--001a114432ae7bd651052acd834f--