Click here to Skip to main content
15,919,931 members
Home / Discussions / Article Writing
   

Article Writing

 
GeneralRe: Researching Opinions: Professional System Library Pin
Jaime Olivares4-Aug-08 1:07
Jaime Olivares4-Aug-08 1:07 
GeneralRe: Researching Opinions: Professional System Library Pin
Vitaly Tomilov4-Aug-08 1:13
Vitaly Tomilov4-Aug-08 1:13 
GeneralRe: Researching Opinions: Professional System Library Pin
Jaime Olivares4-Aug-08 1:23
Jaime Olivares4-Aug-08 1:23 
GeneralRe: Researching Opinions: Professional System Library Pin
Vitaly Tomilov4-Aug-08 1:28
Vitaly Tomilov4-Aug-08 1:28 
GeneralRe: Researching Opinions: Professional System Library Pin
Jaime Olivares4-Aug-08 1:35
Jaime Olivares4-Aug-08 1:35 
GeneralRe: Researching Opinions: Professional System Library Pin
Jaime Olivares4-Aug-08 1:36
Jaime Olivares4-Aug-08 1:36 
GeneralRe: Researching Opinions: Professional System Library Pin
Vitaly Tomilov16-Aug-08 5:20
Vitaly Tomilov16-Aug-08 5:20 
QuestionAny interest in a simple thread-safe lock-free multi-reader multi-writer queue? Pin
supercat93-Jul-08 14:50
supercat93-Jul-08 14:50 
The .net framework provides a queue(of T) which is fine for single-threaded programs, but is not thread-safe. There's a synchronized version, but since it uses locking it runs the risk of priority inversion and other such problems.

I've implemented a fairly simple queueing implementation in VB.net with the following properties:

-1- There are no locks or waits, except that the calling program may elect to wait for data if the queue is empty.

-2- There are a few spinlock loops, but there is no possibility of livelock since each loop will only spin if another thread successfully performed useful work while the loop was executing.

-3- Conceptually, the base queue object does not hold data, but is a place to attach reader objects. Data which is written to a queue will be queued in all reader objects.

As an example situation where this class could be used, think of a multi-line chat BBS. There's a central message queue for all broadcast messages; when a new user logs in, a queue reader is created for that user, attached to the central queue. Whenever a message needs to be broadcast (either a user typed something, or the system wants to report something) it is placed in the queue, where it can be read by all attached readers. Data can be added and removed by any number of different threads without need for synchronization.

I've never written an article for CP before (and haven't done a whole lot with VB), but I think the class seems like it should be useful; I would appreciate feedback and advice (e.g. should I allow the user to receive a WaitHandle from a queue reader, so as to allow the use of WaitAny? If so, can I prevent the user from doing anything with it other than wait?) Would anyone be interested if I were to write up such a thing?
AnswerRe: Any interest in a simple thread-safe lock-free multi-reader multi-writer queue? Pin
Scott Dorman13-Jul-08 2:44
professionalScott Dorman13-Jul-08 2:44 
QuestionSPGridview and related topics Pin
Neophyte301-Jul-08 23:35
Neophyte301-Jul-08 23:35 
QuestionDelete non(article request) Pin
Jaime Olivares21-Jun-08 6:17
Jaime Olivares21-Jun-08 6:17 
AnswerRe: Delete non(article request) Pin
Scott Dorman21-Jun-08 8:00
professionalScott Dorman21-Jun-08 8:00 
GeneralRe: Delete non(article request) Pin
Jaime Olivares21-Jun-08 8:43
Jaime Olivares21-Jun-08 8:43 
GeneralRe: Delete non(article request) Pin
Scott Dorman21-Jun-08 8:45
professionalScott Dorman21-Jun-08 8:45 
GeneralRe: Delete non(article request) Pin
Jaime Olivares21-Jun-08 9:03
Jaime Olivares21-Jun-08 9:03 
GeneralRe: Delete non(article request) Pin
Scott Dorman21-Jun-08 9:15
professionalScott Dorman21-Jun-08 9:15 
GeneralRe: Delete non(article request) Pin
Jaime Olivares3-Aug-08 23:53
Jaime Olivares3-Aug-08 23:53 
AnswerRe: Delete non(article request) Pin
Pete O'Hanlon22-Jun-08 8:46
mvePete O'Hanlon22-Jun-08 8:46 
JokeRe: Delete non(article request) Pin
Jaime Olivares22-Jun-08 8:59
Jaime Olivares22-Jun-08 8:59 
GeneralRe: Delete non(article request) Pin
Pete O'Hanlon22-Jun-08 9:12
mvePete O'Hanlon22-Jun-08 9:12 
GeneralRe: Delete non(article request) Pin
Paul Conrad28-Jun-08 5:21
professionalPaul Conrad28-Jun-08 5:21 
Questionis it possible? Pin
gillardg17-Jun-08 22:16
gillardg17-Jun-08 22:16 
AnswerRe: is it possible? Pin
Pete O'Hanlon18-Jun-08 10:32
mvePete O'Hanlon18-Jun-08 10:32 
AnswerRe: is it possible? Pin
Paul Conrad28-Jun-08 5:23
professionalPaul Conrad28-Jun-08 5:23 
QuestionHelp again Please....i am still learning.....need a tutor Pin
Joselito Garcia15-Jun-08 15:20
Joselito Garcia15-Jun-08 15:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.