Wolfgang-R3f-
-
Content Count
14 -
Joined
-
Last visited
-
Medals
Posts posted by Wolfgang-R3f-
-
-
"Am I the only one who disliked the futuristic approach?"
My opinion...
Yes, i agree : i would like réalistics and usual weaponry.
No prototypes, or futuristic véhicules...
-
There's a small bug preventing from using the script.You'll need to edit R3F_DEBUG\Scripts\cfgR3FInterface.h at line 31 so it reads :
file = "R3F_DEBUG\Scripts\FNC_IF_Inactive[color="Red"]IA[/color].sqf";
i talk about that to the team...
thx for repporting this mistake...
stay tuned.
-
i was thinking about simplifying things... waitUntil seems to be not interruptible and may change things a lot...
i'll look at your code with care...
thx.
-
Here is a peace of code, and test.
I think the code is working properly, i need test now.
Enjoy.
the test:
Spawning 100 thread trying to read and write a global variable at the same time.
variable = 0;
critical = [100] call R3FFUNC_CreateCriticalSection;
R3FFUNC_TestCritical_Writer =
{
private ["_threadID", "_variableBefore"];
_threadID = _this select 0;
while { True } do
{
[critical, _threadID] call R3FFUNC_LockCriticalSection;
_variableBefore = variable;
sleep 1;
variable = _variableBefore + 1;
diag_log format ["[%1] (%2 -> %3)", _threadID, _variableBefore, variable];
[critical, _threadID] call R3FFUNC_UnlockCriticalSection;
};
};
R3FFUNC_TestCritical =
{
for [ {_i = 0 }, { _i < 100 }, { _i = _i + 1 } ] do
{
[_i] spawn R3FFUNC_TestCritical_Writer;
};
};
[] call R3FFUNC_TestCritical;
the critical section code:
Lamport's bakery algorithm in sqf script.
// ********************************************************************************************
// Copyright © 2010 Team ~R3F~
//
// This program is free software under the terms of the GNU General Public License version 3.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @authors team-r3f.org
// @version 1.0
// @date 16/09/2010
//
// critical section implementation based on
// http://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm
// http://black.goucher.edu/~kelliher/cs42/sep27.html
// ********************************************************************************************/
R3FFUNC_InitArray =
{
private ["_array", "_size", "_defaultValue"];
_array = _this select 0;
_size = _this select 1;
_defaultValue = _this select 2;
_array set [_size - 1, _defaultValue];
for [ {_i = 0 }, { _i < _size }, { _i = _i + 1 } ] do
{
_array set [_i, _defaultValue];
};
};
R3FFUNC_MaxValueInArray =
{
private ["_array", "_size", "_maxValue"];
_array = _this select 0;
_size = _this select 1;
_maxValue = 0;
if (_size > 0) then
{
_maxValue = _array select 0;
};
for [ {_i = 1 }, { _i < _size }, { _i = _i + 1 } ] do
{
_maxValue = _maxValue max (_array select _i);
};
_maxValue
};
R3FFUNC_CreateCriticalSection =
{
private ["_maxThreadCount", "_critical", "_entering", "_number"];
_maxThreadCount = _this select 0;
_critical = [[], [], _maxThreadCount];
_entering = _critical select 0;
_number = _critical select 1;
[_entering, _maxThreadCount, False] call R3FFUNC_InitArray;
[_number, _maxThreadCount, 0] call R3FFUNC_InitArray;
diag_log format ["CRITICAL", _critical];
_critical
};
R3FFUNC_LockCriticalSection =
{
private ["_critical", "_threadId", "_maxNumber", "_number", "_entering", "_maxThreadCount"];
_critical = _this select 0;
_threadId = _this select 1;
_entering = _critical select 0;
_number = _critical select 1;
_maxThreadCount = _critical select 2;
assert (_threadId < count _entering);
assert (_threadId < count _number);
_entering set [_threadId, True];
_maxNumber = [_number, _maxThreadCount] call R3FFUNC_MaxValueInArray;
_number set [_threadId, _maxNumber + 1];
_entering set [_threadId, False];
for [ { _j = 0 }, { _j < _maxThreadCount }, { _j = _j + 1 } ] do
{
waitUntil { not ( _entering select _j ) };
waitUntil { not ( ( (_number select _j) != 0) and
( ( (_number select _j) < (_number select _threadId) ) or (((_number select _j) == (_number select _threadId)) and (_j < _threadId))) ) ; };
};
diag_log format ["[%1] ENTER", _threadID];
};
R3FFUNC_UnlockCriticalSection =
{
private [ "_critical", "_threadId", "_number"];
_critical = _this select 0;
_threadId = _this select 1;
diag_log format ["[%1] LEAVE", _threadID];
_number = _critical select 1;
_number set [_threadId, 0];
};
Feel free to try and repport any bug.
---------- Post added at 08:48 PM ---------- Previous post was at 08:40 PM ----------
With Critical Section:
"CRITICAL"
"[18] ENTER"
"[18] (0 -> 1)"
"[18] LEAVE"
"[49] ENTER"
"[49] (1 -> 2)"
"[49] LEAVE"
"[48] ENTER"
"[48] (2 -> 3)"
"[48] LEAVE"
"[50] ENTER"
"[50] (3 -> 4)"
"[50] LEAVE"
"[0] ENTER"
"[0] (4 -> 5)"
"[0] LEAVE"
"[47] ENTER"
"[47] (5 -> 6)"
"[47] LEAVE"
"[99] ENTER"
"[99] (6 -> 7)"
"[99] LEAVE"
"[1] ENTER"
"[1] (7 -> 8)"
"[1] LEAVE"
"[98] ENTER"
"[98] (8 -> 9)"
"[98] LEAVE"
"[96] ENTER"
"[96] (9 -> 10)"
"[96] LEAVE"
Without Critical Section:
"[19] (0 -> 1)"
"[49] (0 -> 1)"
"[50] (1 -> 2)"
"[1] (0 -> 1)"
"[2] (0 -> 1)"
"[3] (0 -> 1)"
"[4] (0 -> 1)"
"[5] (0 -> 1)"
"[6] (0 -> 1)"
"[7] (0 -> 1)"
"[8] (0 -> 1)"
"[9] (0 -> 1)"
"[10] (0 -> 1)"
"[11] (0 -> 1)"
"[12] (0 -> 1)"
"[13] (0 -> 1)"
"[14] (0 -> 1)"
"[15] (0 -> 1)"
"[16] (0 -> 1)"
"[17] (0 -> 1)"
"[18] (0 -> 1)"
"[19] (1 -> 2)"
"[20] (1 -> 2)"
"[21] (1 -> 2)"
"[22] (1 -> 2)"
"[23] (1 -> 2)"
"[24] (1 -> 2)"
"[25] (1 -> 2)"
"[26] (1 -> 2)"
"[27] (1 -> 2)"
"[28] (1 -> 2)"
"[29] (1 -> 2)"
"[30] (1 -> 2)"
"[31] (1 -> 2)"
-
Hello,
First apologies for starting a new thread, but i really did not find any clear answers about multithread programming in scripts... dispite i found the questions...
Is there anywhere any sample of sqf script (for ArmaII Op Arrowhead) that would ensure atomicity in a chunck of code ?
Thank's for yours answers.
-
okay :), i'll be available for any additionnal test if needed. Great Thank.
-
some news ? any tips ?
thx !
-
Here is the full content of be.log after trying another random server.
May this help more...
Have you got any idea about the trouble ?
Bad files on my computer ? (arma1 still installed..., win vista 64 bit with uac...)
Or bad Network configuration ? i don't think so... DHCP, and port redirection done correctly i think...
Conflict with another program ? how may i test this ?
I've read that battleye would auto-update itself, did i ?
Before trying with the BEv1.141, i retry with the old version to see if an auto-update was done... there wasn't so i put the new dll at the good place...
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
816 24 0 91.121.75.25:2302 16
i1 0
o2 0 816 91.121.75.25:2302
i1 0
o2 0 816 91.121.75.25:2302
i1 0
o2 0 816 91.121.75.25:2302
i1 0
o2 0 816 91.121.75.25:2302
-
816 24 0 80.190.191.125:2302 16
-
816 24 0 80.190.191.125:2302 16
i1 0
o2 0 816 80.190.191.125:2302
-
816 24 0 91.121.97.15:2302 16
i1 0
o2 0 816 91.121.97.15:2302
i1 0
o2 0 816 91.121.97.15:2302
i1 0
o2 0 816 91.121.97.15:2302
i1 0
o2 0 816 91.121.97.15:2302
-
Thank's for support Battleye-Guy!
I get back to you asap!
EDIT:
here is my be.log with battleye v1.141.
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
816 24 0 91.121.75.25:2302 16
i1 0
o2 0 816 91.121.75.25:2302
i1 0
o2 0 816 91.121.75.25:2302
i1 0
o2 0 816 91.121.75.25:2302
i1 0
o2 0 816 91.121.75.25:2302
-
Another BE.log... it seems to be different.
Because of Firewall desactivated now on my computer ?
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
-
;1578726']Hello' date='I've looked for a solution to my problem for 2 month almost now...
I have the "client not responding" problem too.
I've downloaded the new dll from BattlEye site : the version number at battleye initialization is indeed 1.140.
BattlEye Client Initialized (v1.140)
#beclient test
BattlEye Client: Test Enabled
#beclient guid
BattlEye Client: My GUID:
no guid ?
.
[/quote']
be.log found !
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
-
-
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
i1 0
o2 0
Thank you for help !
-
Hello,
I've looked for a solution to my problem for 2 month almost now...
I have the "client not responding" problem too.
I've downloaded the new dll from BattlEye site : the version number at battleye initialization is indeed 1.140.
BattlEye Client Initialized (v1.140)
#beclient test
BattlEye Client: Test Enabled
#beclient guid
BattlEye Client: My GUID:
no guid ?
Config: Windows Vista. (arma game re-installed, patch too, dll downloaded), fraps running, g13 running, track ir running, UAC not desactivated, router configured enough to allow me to play without battleye, DHCP at home...), no BE.log output, arma2 launched in administrator, firewall on (with permission for arma2.exe).
I'm the only one of my team having this problem...
huhuhu :(...
thank...
Am I the only one who disliked the futuristic approach?
in ARMA 3 - GENERAL
Posted · Edited by Wolfgang[R3f]
Things can exists and neverless not be so usual, or standard.
My knowledge in warfare is limited and i expect people to counter-say my words. Don't worry, i take things very easy ;), i want to learn...