+- lttvwindow_process_pending_requests
+
+This internal function gets called by g_idle, taking care of the pending
+requests. It is responsible for concatenation of time intervals and position
+requests. It does it with the following algorithm organizing process traceset
+calls. Here is the detailed description of the way it works :
+
+
+
+- Revised Events Requests Servicing Algorithm (v2)
+
+The reads are splitted in chunks. After a chunk is over, we want to check if
+there is a GTK Event pending and execute it. It can add or remove events
+requests from the event requests list. If it happens, we want to start over
+the algorithm from the beginning. The after traceset/trace/tracefile hooks are
+called after each chunk, and before traceset/trace/tracefile are
+called when the request processing resumes. Before and after request hooks are
+called respectively before and after the request processing.
+
+
+Data structures necessary :
+
+List of requests added to context : list_in
+List of requests not added to context : list_out
+
+Initial state :
+
+list_in : empty
+list_out : many events requests
+
+
+// NOT A. While (list_in !empty or list_out !empty) and !GTK Event pending
+
+We do this once, go back to GTK, then get called again...
+We remove the g_idle function when list_in and list_out are empty
+
+ 1. If list_in is empty (need a seek)
+ 1.1 Add requests to list_in
+ 1.1.1 Find all time requests with lowest start time in list_out (ltime)
+ 1.1.2 Find all position requests with lowest position in list_out (lpos)
+ 1.1.3 If lpos.start time < ltime
+ - Add lpos to list_in, remove them from list_out
+ 1.1.4 Else, (lpos.start time >= ltime)
+ - Add ltime to list_in, remove them from list_out
+ 1.2 Seek
+ 1.2.1 If first request in list_in is a time request
+ - If first req in list_in start time != current time
+ - Seek to that time
+ 1.2.2 Else, the first request in list_in is a position request
+ - If first req in list_in pos != current pos
+ - seek to that position
+ 1.3 Add hooks and call before request for all list_in members
+ 1.3.1 If !servicing
+ - begin request hooks called
+ - servicing = TRUE
+ 1.3.2 call before chunk
+ 1.3.3 events hooks added
+ 2. Else, list_in is not empty, we continue a read
+ 2.1 For each req of list_out
+ - if req.start time == current context time
+ - Add to list_in, remove from list_out
+ - If !servicing
+ - Call before request
+ - servicing = TRUE
+ - Call before chunk
+ - events hooks added
+ - if req.start position == current position
+ - Add to list_in, remove from list_out
+ - If !servicing
+ - Call before request
+ - servicing = TRUE
+ - Call before_chunk
+ - events hooks added
+
+ 3. Find end criterions
+ 3.1 End time
+ 3.1.1 Find lowest end time in list_in
+ 3.1.2 Find lowest start time in list_out (>= than current time*)
+ * To eliminate lower prio requests (not used)
+ 3.1.3 Use lowest of both as end time
+ 3.2 Number of events
+ 3.2.1 Find lowest number of events in list_in
+ 3.2.2 Use min(CHUNK_NUM_EVENTS, min num events in list_in) as num_events
+ 3.3 End position
+ 3.3.1 Find lowest end position in list_in
+ 3.3.2 Find lowest start position in list_out (>= than current
+ position)
+ 3.3.3 Use lowest of both as end position
+
+ 4. Call process traceset middle
+ 4.1 Call process traceset middle (Use end criterion found in 3)
+ * note : end criterion can also be viewer's hook returning TRUE
+ 5. After process traceset middle
+ - if current context time > traceset.end time
+ - For each req in list_in
+ - Remove events hooks for req
+ - Call end chunk for req
+ - Call end request for req
+ - remove req from list_in
+ 5.1 For each req in list_in
+ - req.num -= count
+ - if req.num == 0
+ - Remove events hooks for req
+ - Call end chunk for req
+ - Call end request for req
+ - remove req from list_in
+ - if current context time > req.end time
+ - Remove events hooks for req
+ - Call end chunk for req
+ - Call end request for req
+ - remove req from list_in
+ - if req.end pos == current pos
+ - Remove events hooks for req
+ - Call end_chunk for req
+ - Call end request for req
+ - remove req from list_in
+ - if req.stop_flag == TRUE
+ - Remove events hooks for req
+ - Call end chunk for req
+ - Call end request for req
+ - remove req from list_in
+
+B. Between each chunk (interrupted or not)
+ 1. for each request in list_in
+ 1.1. Use current postition as start position
+ 1.2. Remove start time
+ 1.3. Call after_chunk_traceset
+ 1.4. Remove event hooks
+ 1.5. Put it back in list_out
+
+
+
+Notes :
+End criterions for process traceset middle :
+If the criterion is reached, event is out of boundaries and we return.
+Current time >= End time
+Event count > Number of events
+Current position >= End position
+Last hook list called returned TRUE
+
+The >= for position is necessary to make ensure consistency between start time
+requests and positions requests that happens to be at the exact same start time
+and position.
+
+
+
+
+Weaknesses
+
+- ?
+