rock’n roll

June 24, 2005

sylpheed IMAP

Filed under: mail — dinhviethoa @ 8:56 pm

1. plan for implementation of IMAP in sylpheed

- let’s use a persistent thread for all network connexions (main thread won’t block)
- use libetpan IMAP (low-level part)

imap thread :

while (!finished) {
   process_imap_command();
}


main thread :

imap_command()
{
  /*1 */
  queue_imap_command_in_thread();
  /* 2 */
  while (!command_finished) {
    gtk_event_loop(); /* (2.a.) */
  }
  /* 3 */
  convert_libetpan_result_to_sylpheed_data();
  /* 4 */
  match_previous_implementation_of_sylpheed();
}

we won’t need locks since concurrency will be handled by the imap thread.
(1) will queue the command in the thread
(2) will wait for the result of the command
(3) will convert libetpan data to sylpheed data structure
(4) will do the other stuff of previous implementation

(1) and (2)
the function must be reentrant during (1, 2) since other imap command can be called during that time (2.a.).
It looks like commands result will be processed in reversed order, is that a problem ?

2. comment
asynchronous API is really needed in sylpheed

3. let’s implement

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.