That sounds like a good idea. 
The thing is, that the messages are already kept in memory, in the SMSC driver, which 
then returns it to the bearerbox using bb_smsconn_sent() or bb_smsconn_send_failed(). 
maybe it's easier to use that, and modify the implementation of the drivers not to 
copy the message they received using the queue() call back, but only get a reference 
to it. then the bearerbox won't delete the message after sending it to the driver and 
keep it in said dictionary. when the driver is finished with the message and sends it 
back, using the sent (ack) or send_failed (nack) calls, it is then matched. that way 
no duplication of the message in memory is needed, and there is only one message 
structure for a single message in the entire process. of course - it also means that 
two threads (maybe more) are sharing the same memory structure (even though the 
bearebox doesn't do anything with it while it's in the driver control - simply storing 
it), so all need to play nice together.
You also don't need to store acks in the store, as only unacked messages are stored 
there. 

--
Oded Arbel
m-Wise Mobile Solutions

[EMAIL PROTECTED]
Mobile: +972-67-340014
Tel: +972-9-9581711 (ext: 116)

::..
"There's many a bestseller that could have been prevented by a good teacher."
        -- Flannery O'Connor


> -----Original Message-----
> From: Kalle Marjola [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 3:43 PM
> Cc: [EMAIL PROTECTED]
> Subject: Re: Message store (Was: EMI: Serious Problem PANIC: 
> Too manyconcurrent allocations)
> 
> 
> On Wed, 12 Jun 2002, Aarno Syv�nen wrote:
> 
> > Speaking of store files - After really looking into the 
> store logic, it 
> 
> The better way to implement the store file (than the old way 
> I did quickly 
> use - you have to remember that original store file was just 
> a quick hack 
> to concentrate more on SMS side that almost-useless-WAP ;)
> 
>  - like earlier, write all messages and acks and nacks to file
>  - keep copy of all non-acked messages in memory
>  - when Kannel receives an ack (or nack), write a new store file out
>    of still remaining (non-acked) messages to replace the old.
>    Naturally only do this now and then, like if there has not 
> been writing 
>    in last half a minute. (and of course first write to new 
> file and then 
>    rename etc.)
> 
> 
> ..this way the store file normally keeps empty or only some 
> odd messages, 
> unless lots of messages do not get (n)acks. Of course this means that
> Kannel will grow in memory if messages do not get ackked, too.
> 
> 
> -- 
>                   &kalle marjola
> 
> 
> 

Reply via email to