Re: RFC mailbox interface

On 19 Nov 2001, 20:44:31 Kenneth Haley wrote:
> > I just thought of a problem with vfolders.  Remember that there is 
> > only one Message struct per source message.  What happens when a user 
> > deletes
> > a) the vfolder message
> > b) the source message
> Looks like I'm replying to myself again.  This is based on some 
> comments from Melanie in another part of the thread.  The only change 
> to the API is to add a Folder list to the Message for holding the 
> vfolders that contain the message.  It also requires that balsa keeps 
> and uses its own copy of the Folder* at least for vfolders.  This is 
> how I currently see the life of a vfolder:
> Balsa creates the vfolder and populates it with 
> vfolder->copyMessage(src).  This copies the src pointer into the 
> vfolders message list and adds the vfolder to the list in each 
> Message.  Just to be clear there is only one copy of the Message 
> structure in memory with 2 or more folders referncing it.  Now the fun 
> part.
> If the user deletes the vfolder entry then the message is only removed 
> from the vfolder.  Balsa has to use its own Folder* here.
> if the user selects delete all on the vfolder or deletes the source 
> Message then balsa has to walk the vfolder list in the Message deleting 
> it from each one and then delete the source message.

It sounds like a hash table lookup would be the way to go for this, unless
the number of vfolders is small in which case a singly-linked list would be
better. I don't think sorting the list of vfolders would be necessary. For
walking the list and deleting how do you like the idea of a separate thread
being spawned for each vfolder? 

James C. McPherson

TSG Engineer (Kernel/Storage)           828 Pacific Highway
APAC Customer Care Centre               Gordon NSW 
Sun Microsystems Australia              2072

Failfast panic: those controlling voices in my head have 
stopped telling me what to do.....

Read about the VOS Initiative at

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]