Re: Multi Threading Options
- From: "Mark Randall" <markyr@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Jun 2005 05:06:25 +0100
My problem is that I want to run a pretty hefty drawing routine on the other
thread - I really want to cause thread 2 to wait for data to finish being
written before it starts drawing the next image, and cause thread 2 to tell
thread one it can update again once it has finished drawing.
My problem is I recieve live events from a server, these events update
records in a linked list, and sometimes trigger a response from one of the
entries in the linked list which may include another loop, for example... if
I recieve a 'chat' type of message that relates to one of my linked list
values, i may need to itterate through each one - sending a message back to
them, which may change values within them.
At the same time I want another dialog to be running a map of them (they are
avatars represented in 3d space, their positions, attributes etc). However,
the SDK that I use from Active Worlds will soon be multithreaded itself, and
it is important that I find a way to make my shared global variables safe...
otherwise im a tad screwed basically!
--
- Mark Randall
http://zetech.swehli.com
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:ma9q91tdh86lav3q38c7v67p2eed44n7gg@xxxxxxxxxx
> There is no multiple-reader-single-writer synchronization primitive at
> user level.
>
> If you have circular lists, and you lock them from two different threads,
> you are almost
> certainly a candidate for deadlock.
>
> Generally, most people seem to ignore the MFC locking primitives because
> of the bizarre
> implementations. Go for the raw synchronization primitives.
>
> The multiple-reader-single-writer problem can be solved in a fairly clumsy
> way, by opening
> a file in read+write mode, and using a file lock. File locks allow
> multiple readers and
> single writers. But they don't solve the deadlock problem, unless you
> apply the lock to
> the entire structure. And I have no idea of the overhead involved in this
> technique; it
> might swamp the nominal gain of having multiple readers run concurrently.
> joe
.
- Follow-Ups:
- Re: Multi Threading Options
- From: Scott McPhillips [MVP]
- Re: Multi Threading Options
- References:
- Multi Threading Options
- From: Mark Randall
- Re: Multi Threading Options
- From: Joseph M . Newcomer
- Multi Threading Options
- Prev by Date: Re: Set Client Size ?
- Next by Date: Re: Item Image
- Previous by thread: Re: Multi Threading Options
- Next by thread: Re: Multi Threading Options
- Index(es):
Loading