Example
#{example}"); ipb.editor_values.get('templates')['togglesource'] = new Template(""); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = new Template("
Emoticons
"); // Add smilies into the mix ipb.editor_values.set( 'show_emoticon_link', false ); ipb.editor_values.set( 'bbcodes', $H({"snapback":{"id":"1","title":"Post Snap Back","desc":"This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default.","tag":"snapback","useoption":"0","example":"[snapback]100[/snapback]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"topic":{"id":"5","title":"Topic Link","desc":"This tag provides an easy way to link to a topic","tag":"topic","useoption":"1","example":"[topic=1]Click me![/topic]","switch_option":"0","menu_option_text":"Enter the topic ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"post":{"id":"6","title":"Post Link","desc":"This tag provides an easy way to link to a post.","tag":"post","useoption":"1","example":"[post=1]Click me![/post]","switch_option":"0","menu_option_text":"Enter the Post ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"spoiler":{"id":"7","title":"Spoiler","desc":"Spoiler tag","tag":"spoiler","useoption":"0","example":"[spoiler]Some hidden text[/spoiler]","switch_option":"0","menu_option_text":"","menu_content_text":"Enter the text to be masked","single_tag":"0","optional_option":"0","image":""},"acronym":{"id":"8","title":"Acronym","desc":"Allows you to make an acronym that will display a description when moused over","tag":"acronym","useoption":"1","example":"[acronym='Laugh Out Loud']lol[/acronym]","switch_option":"0","menu_option_text":"Enter the description for this acronym (EG: Laugh Out Loud)","menu_content_text":"Enter the acronym (EG: lol)","single_tag":"0","optional_option":"0","image":""},"hr":{"id":"12","title":"Horizontal Rule","desc":"Adds a horizontal rule to separate text","tag":"hr","useoption":"0","example":"[hr]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"php":{"id":"14","title":"PHP Code","desc":"Allows you to enter PHP code into a formatted/highlighted syntax box","tag":"php","useoption":"0","example":"[php]$variable = true;\n\nprint_r($variable);[/php]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"html":{"id":"15","title":"HTML Code","desc":"Allows you to enter formatted/syntax-highlighted HTML code","tag":"html","useoption":"0","example":"[html]\n \n[/html]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"sql":{"id":"16","title":"SQL Code","desc":"Allows you to enter formatted/syntax-highlighted SQL code","tag":"sql","useoption":"0","example":"[sql]SELECT p.*, t.* FROM posts p LEFT JOIN topics t ON t.tid=p.topic_id WHERE t.tid=7[/sql]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"xml":{"id":"17","title":"XML Code","desc":"Allows you to enter formatted/syntax-highlighted XML code","tag":"xml","useoption":"0","example":"[xml]3 Replies - 36 Views - Last Post: Yesterday, 10:11 PM
#1
Reputation: 3
- Posts: 210
- Joined: 23-February 12
Posted Yesterday, 09:45 PM
I know how to code it, I was just curious, using WINAPI threading, which I have gotten down, I was wondering if it was possible to access the same array with multiple threads. I know for sure that, say, thread one needs index 1 and thread two needs index 1, whichever gets there first has it, but can i access the same array overall with different threads? I know how to code it, so this is a conceptual question. I looked it up on google, but can't find any answers.
Is This A Good Question/Topic? 0
Replies To: MultiThreading and Arrays?
#2
Reputation: 603
- Posts: 1,866
- Joined: 02-August 09
Re: MultiThreading and Arrays?
Posted Yesterday, 09:55 PM
Yes, different threads can access the same resources, since threads within a single program share the same address space. However, care should taken that access is thread safe (a resource is only accessed by one thread at a time). For this, you can use critical sections.#3
Reputation: 1931
- Posts: 5,757
- Joined: 05-May 12
Re: MultiThreading and Arrays?
Posted Yesterday, 09:57 PM
All threads can always read. It's not a matter of the first reader locking out the other readers.Writing on the other hand can get a little dicey. Writing also does not lock out the other writers. The last writer wins. This can cause some confusion in your program logic if you have two threads writing and each thought that their write was the winner.
This is why you usually want to have some kind of synchronization mechanism to only allow one writer at a time so that you can have some kind of certainty of what order operations happen in. Also the synchronization helps if you need to prevent writers from writing while you are in the process of reading and need some kind of stability in the values.
This post has been edited by Skydiver: Yesterday, 09:58 PM
#4
Reputation: 3
- Posts: 210
- Joined: 23-February 12
Re: MultiThreading and Arrays?
Posted Yesterday, 10:11 PM
Page 1 of 1
Source: http://www.dreamincode.net/forums/topic/321712-multithreading-and-arrays/
kindle fire Jenny Johnson olivier martinez ny lottery Ohio Lottery Colorado Lottery Pa Lottery
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.