FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

looking for a queue or semaphore [phobos, win32]

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
cracki



Joined: 07 May 2007
Posts: 10
Location: Germany

PostPosted: Thu May 24, 2007 10:15 am    Post subject: looking for a queue or semaphore [phobos, win32] Reply with quote

Hi,

i'm looking for a queue or semaphore
i'm running DMD/phobos on win32

my program:
one thread produces images, the other thread displays them with tight timing.
i need to produce images in advance so they can be displayed without the delay that creating them would incur.

ideas?
_________________
...meh...
Back to top
View user's profile Send private message
Rommie



Joined: 23 Aug 2007
Posts: 6

PostPosted: Thu Aug 23, 2007 3:47 pm    Post subject: Reply with quote

Well, you get mutexes for free.

http://www.digitalmars.com/d/statement.html#SynchronizedStatement

So you just synchronize (mutex-lock) your image class, then you can have one thread writing and another thread reading, and all should be well.

I think...
Back to top
View user's profile Send private message
cracki



Joined: 07 May 2007
Posts: 10
Location: Germany

PostPosted: Thu Aug 23, 2007 5:33 pm    Post subject: Reply with quote

(1) it's pure luck that i noticed my old thread on the "new threads" list
(2) i knew of synchronized back then. it's a low level primitive that i feel no urge to implement stuff on that's supposed to be coming with the stdlib
(3) thanks for minding
_________________
...meh...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group