From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: bartv@redhat.com Cc: RBalakum@chn.cts-corp.com, ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] Variable size Message boxes Date: Tue, 31 Oct 2000 09:17:00 -0000 Message-id: <39FEFE78.7E34E734@redhat.com> References: <0B9BF5AE8A3ED21196980060B0B5455102B6E76A@ctsinentsxua> <200010311307.e9VD7pB28580@sheesh.cygnus> X-SW-Source: 2000-10/msg00400.html Bart Veer wrote: > > >>>>> "Rajendran," == Rajendran, Balakumaran (CTS) writes: > > Rajendran> I need to create message boxes of variable sizes for my > Rajendran> application. In ECOS, the size of the message box can > Rajendran> be configured by the > Rajendran> CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE parameter. But all > Rajendran> the message boxes created will be of the same size. Is > Rajendran> there a way by which variable size message boxes can be > Rajendran> created and used? > > Not with the message boxes provided by the kernel. > > It is not clear whether you want message boxes which can change size > dynamically, or if you want message boxes of different but fixed sizes. It the latter you can use POSIX message queues from from the EL/IX code in CVS. Or even use the Cyg_MQueue type which is part of the kernel, in , but which is not part of the *exported* API because it is solely present to support POSIX message queues. This means C++ for a start, and the documentation for that API is whatever is in mqueue.hxx :-). It's a private internal API. > The former would require some form of dynamic memory allocation, i.e. > if you post to a full message box then the kernel would need to extend > the message box. There's a simpler way to do it. Just make the kernel message boxes take void *'s, and then it is up to the *application* to malloc stuff, and then when it is received, free it. That is the intended use of the kernel message boxes to make the implementation simplest and fastest. Jifl -- Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762 "Plan to be spontaneous tomorrow." || These opinions are all my own fault