[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> I'm pretty sure it is possible to change the cursor, though I
> vaguely remember having a hard time looking through the headers.
> Try doing a recursive grep through the `include' directories.
Ok, I'll search for it.
> I think I was just following the sample code in the BeBook. If you
> think it would improve performance to do it another way, go ahead,
> although I'm pretty sure there would have been a good reason for me
> to be messing around with threads. I have a feeling CPU usage isn't
> very high, since we do not have the function call overhead, and
> because we are `snooze'ing. Anyway, these are all guesses.
I'll continue using the thread based updater then. Anyway I'm having a bit of
problems with synchronization after my modifications (I added line switching
routines that mark dirty lines, so we update just them); I've read parts of the
threads intro on the BeBook, and I think I'm doing right this way:
- I create a new semaphore in the BDirectWindow constructor, initializing the
counter to 0.
- Inside the window redrawer thread, before doing the update I do an
acquire_sem() on that sem, releasing it only at the end of the window update.
- In the line switching read/write routine I do an acquire_sem() on the same
sem, if the sem has not been yet acquired, and I release it on the unwrite_bank
routine.
Well, this makes programs to crash while drawing (gfx initialization works).
I used semaphores because dirty line flags could be changed while the redrawer
thread is updating the window, and that's bad as it can make mistakes leaving
some lines unupdated...
> BTW, I wrote down a TODO list when I first posted the patch. I can
> send it to you privately if you want.
I looked over my AD archive and I found your original post (on April, the 15th
2000), with the todo list. Thanks anyway!
BTW, why didn't you finish the driver by yourself? Lack of time/interest or
what? Just curious.
--
Angelo Mottola
a.mottola@xxxxxxxxxx