netsurf/amiga/schedule.h
Chris Young 6bced73998 Modify scheduler to use a binary heap (using libpbl).
Scheduled events are now in event time order, so schedule_run simply takes the top
event off the heap and runs it (if we're polling, rather than having received a signal
that the next event is due to be run, we check first that we have passed the scheduled
time).

This should provide performance benefits as we are no longer trawling the entire list
of scheduled events (potentially hundreds) every time an event is signalled or the
schedule list is polled.

svn path=/trunk/netsurf/; revision=11703
2011-02-16 21:29:39 +00:00

32 lines
993 B
C
Executable File

/*
* Copyright 2008 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* NetSurf is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* NetSurf is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AMIGA_SCHEDULE_H
#define AMIGA_SCHEDULE_H
#include <proto/timer.h>
#include "amiga/os3support.h"
struct TimeRequest *tioreq;
struct MsgPort *msgport;
BOOL ami_schedule_create(void);
void ami_schedule_free(void);
void schedule_run(BOOL poll);
#endif