This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Playing with memory pool and timeouts ...


On Tue, Jul 01, 2003 at 04:26:02PM +0200, Matthieu.GIRARDIN@fr.thalesgroup.com wrote:
> Hi everybody !
> 
> Does someone know how to fill the last parametre of
> cyg_semaphore_timed_wait() ?
> Is it the number of ticks real (the system add itself the current realtime)
> or must I pass 
> to this fonction, as parametre, realtime + nb_ticks ?

It takes the absolute time to wake up. So you want to pass something like

(cyg_current_time() + nb_ticks)  

> I have the same question for the posix fonction mq_timedreceive() with its
> structure timespec ...

I've never used the posix code. Im sure you can read the code and work
it out just as easily as i could....
 
> Another thing; Andrew answered me the number of extra blocks (to calculate
> the size to malloc for a 
> mempoolspace knowing the size we want) is :
> 	(size/blocksize) - ((size/blocksize/8/blocksize) + 1
> 								(Thanks a
> lot Andrew)
> but : 	1) He told me also, that it's underestimate by 1, so can I change
> the "+ 1" by "+ 2" ?
> 	2) Is it really size/blocksize/8/blocksize ? Is it really a division
> of size by blocksize then
> 	a division by 8 the a division by blocksize ? For me it's the same
> thing with
> 		(size * 8) / (blocksize ² ), am I right ?

The best answer to this is to read the code! Once you understand the
code, you can work out your own formula. You can then tell me if i've
got it wrong (which is quite possible!).

      Andrew

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]